How to install MySQL-python by pip?

venv/bin/pip install MySQL-python
Collecting MySQL-python
  Downloading MySQL-python-1.2.5.zip (108kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 112kB 1.2MB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/1j/pb3h7_hn4490px72_f8mntd00000gn/T/pip-build-o66zhy67/MySQL-python/setup.py", line 13, in <module>
        from setup_posix import get_config
      File "/private/var/folders/1j/pb3h7_hn4490px72_f8mntd00000gn/T/pip-build-o66zhy67/MySQL-python/setup_posix.py", line 2, in <module>
        from ConfigParser import SafeConfigParser
    ImportError: No module named 'ConfigParser'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/1j/pb3h7_hn4490px72_f8mntd00000gn/T/pip-build-o66zhy67/MySQL-python/

I am trying to install MySQL-pythonby pip, but it exceeded the error. Can anyone help?

I checked this page How to install Python MySQLdb module using pip? but it really doesn’t help.

This is python3.5 in my virtualenv folder.

+4
source share
2 answers

Now I got it. Thanks for the clarification.

I worked on your setup and duplicated the result. Further research shows that MySQL-python is for Python 2.x only. One of the recommendations I found is to use mysqlclient, but when I installed it, I got the same error.

, Windows 10 dev, Visual Studio 2015, "my_config.h" . , .

, PyMySql . pip install pymysql env.

, .

+3

brew mysql

mysql .

sudo PATH =/usr/local/Cellar/mysql/bin/: $PATH pip install mysql-python

-2

Source: https://habr.com/ru/post/1660326/


All Articles