virtualenv(python3.4), pip install mysqlclient error

匿名 (未验证) 提交于 2019-12-03 01:47:02

问题:

I created virtualenv for django 1.9 project. I am trying to pip install mysqlclient or mysql-python but both of them gives me errors.

pip install mysqlclient  pip install mysql-python

both give me the same error message:

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/r4/bkv_4t9s4r140pjkgv6lsq8w0000gn/T/pip-build-cdxcssp9/mysqlclient

any suggestions!?

回答1:

Try to run this before:

sudo apt-get install python-dev python3-dev sudo apt-get install libmysqlclient-dev pip install pymysql pip install mysqlclient


回答2:

  1. Download the MySQL APT repository config tool (you can see more details here: http://dev.mysql.com/downloads/repo/apt/)

    wget http://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb
  2. Install the MySQL APT repository config tool

    dpkg -i mysql-apt-config_0.7.3-1_all.deb

You will be asked to select product and version that you want to install. In the first step, select Server and next select either mysql-5.6 or mysql-5.7. Then click Apply.

  1. Update APT

    apt-get update
  2. Install the server

    sudo apt-get install mysql-community-server  sudo apt-get install python-dev python3-dev sudo apt-get install libmysqlclient-dev pip install pymysql pip install mysqlclient


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!