2

I am currently trying to install mysqlclient-python on ubuntu to use with Django and am having issues.

I am following this page: https://github.com/PyMySQL/mysqlclient-python

However, when I run 'pip install mysqlclient' I get the following error:

running install_lib

copying build/lib.linux-x86_64-2.7/_mysql_exceptions.py -> /usr/local/lib/python2.7/dist-packages

error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/_mysql_exceptions.py'

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_robofish/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ynYYW0-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_robofish/mysqlclient
Storing debug log for failure in /home/robofish/.pip/pip.log

I checked the /usr/local/lib/python2.7/ directory, and it seems to be empty. Could this be the problem?

0

1 Answer 1

5

It seems you're trying to install mysqlclient in your global Python environment. I'd strongly recommend to use virtualenv to create an isolated Python environment.

If you still want to use the global environment, use sudo pip install mysqlclient.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.