A
A
Alexander2016-03-29 12:50:06
Python
Alexander, 2016-03-29 12:50:06

How to properly install Mysql for pip3.5?

when running the server python3.5 manage.py runserver , the following pops up. mistake

....................
 File "/usr/local/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 28, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb'

I try to install like this:
Terminal:
[email protected]:~/Numero_Project/turon-out.pro$ sudo pip3.5 install MySQl-python
The directory '/home/alexander/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/alexander/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied (use --upgrade to upgrade): MySQl-python in /usr/local/lib/python2.7/dist-packages

It is installed for python2.7 and i need 3.5

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
newpy, 2016-03-29
@newpy

i downloaded mysqlclient-1.3.7-cp27-none-win_amd64.whl

Read here
https://github.com/PyMySQL/mysqlclient-python/issues/54
In short, Python 3.5 is compiled with VC2015. The author of mysqlclient compiled under VC2014, so his library does not work with Python 3.5. Until some time, there was no way out, it was necessary to recompile its sources from under VC2015. The author did not have such an opportunity, as he wrote in the issue. But there are good people.
Pay attention to @jokey2k's answer, in his answer there is a link that gives the required whl package under win64 cp35
pyside.markus-ullmann.de/mysqlclient-win/mysqlclie...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question