Voulkan
Voulkan

Reputation: 21

Can't install mysqlclient-python on Linux Ubuntu

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?

Upvotes: 2

Views: 1473

Answers (1)

knbk
knbk

Reputation: 53649

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.

Upvotes: 5

Related Questions