0

I am following https://www.tutorialspoint.com/python/python_database_access.htm to connect Python with SQL.

gunzip MySQL-python-1.2.2.tar.gz
tar -xvf MySQL-python-1.2.2.tar
cd MySQL-python-1.2.2
python setup.py build
python setup.py install

The last command "python setup.py install" gives :

error: [Errno 13] Permission denied: '/anaconda/lib/python2.7/site-packages/easy-install.pth'

1 Answer 1

1

Using Anaconda, you should use conda install <package-name>

Linux / Windows: conda install mysql-python

Mac OS: conda install --channel https://conda.anaconda.org/coursera mysql-python

Then it will check for dependencies and install them for you.

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

5 Comments

Does not work. conda install mysql-python Using Anaconda Cloud api site api.anaconda.org Fetching package metadata: .... Solving package specifications: . Error: Package missing in current osx-64 channels: - mysql-python
OK. That was the Linux version. I'll get the OSX setup for you.
Updated with Mac OS instructions. Verified working in Python 2.7 Anaconda
Uprooted but not verified. Thanks a lot. I trust your solution is right, but it did not work for me. I can install it now with OSX terminal, but cannot import it in Python. ERROR MESSAGE: import MySQLdb Traceback (most recent call last): File "<stdin>", line 1, in <module> File "//anaconda/lib/python2.7/site-packages/MySQLdb/__init__.py", line 19, in <module> import _mysql ImportError: dlopen(//anaconda/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: libssl.1.0.0.dylib Referenced from: //anaconda/lib/python2.7/site-packages/_mysql.so Reason: image not found
Looks like an openssl error now. Try the following links that seem to address this part of the problem. stackoverflow.com/a/19172859/3006366 and stackoverflow.com/a/20946142/3006366 (Both separate answers to the same post)

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.