pip

pip

pip 安装MySQL-python:EnvironmentError: mysql_config not found

服务端atool 发表了文章 • 0 个评论 • 1547 次浏览 • 2016-11-21 20:43 • 来自相关话题

网上很多做法是:
 首先 find / -name mysql_config 在/usr/bin/下发现了这个文件
然后修改MySQL-python-1.2.5目录下的site.cfg文件
去掉mysql_config=XXX这行的注释,并改成mysql_config=/usr/bin/mysql_config(以mysql_config文件所在机器上的目录为准)


然后 python setup.py install
 
但是这样安装会出现:ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

[Errno 13] Permission denied: '/root/.cache'

The Python egg cache directory is currently set to:

/root/.cache/Python-Eggs

Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.
最后解决办法:
 
首先:apt-get install libmysqlclient-dev
 
然后再 pip install MySQL-python,解决。 查看全部
网上很多做法是:
 
首先 find / -name mysql_config 在/usr/bin/下发现了这个文件
然后修改MySQL-python-1.2.5目录下的site.cfg文件
去掉mysql_config=XXX这行的注释,并改成mysql_config=/usr/bin/mysql_config(以mysql_config文件所在机器上的目录为准)


然后 python setup.py install
 
但是这样安装会出现:
ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

[Errno 13] Permission denied: '/root/.cache'

The Python egg cache directory is currently set to:

/root/.cache/Python-Eggs

Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

最后解决办法:
 
首先:apt-get install libmysqlclient-dev
 
然后再 pip install MySQL-python,解决。

pip 安装MySQL-python:EnvironmentError: mysql_config not found

服务端atool 发表了文章 • 0 个评论 • 1547 次浏览 • 2016-11-21 20:43 • 来自相关话题

网上很多做法是:
 首先 find / -name mysql_config 在/usr/bin/下发现了这个文件
然后修改MySQL-python-1.2.5目录下的site.cfg文件
去掉mysql_config=XXX这行的注释,并改成mysql_config=/usr/bin/mysql_config(以mysql_config文件所在机器上的目录为准)


然后 python setup.py install
 
但是这样安装会出现:ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

[Errno 13] Permission denied: '/root/.cache'

The Python egg cache directory is currently set to:

/root/.cache/Python-Eggs

Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.
最后解决办法:
 
首先:apt-get install libmysqlclient-dev
 
然后再 pip install MySQL-python,解决。 查看全部
网上很多做法是:
 
首先 find / -name mysql_config 在/usr/bin/下发现了这个文件
然后修改MySQL-python-1.2.5目录下的site.cfg文件
去掉mysql_config=XXX这行的注释,并改成mysql_config=/usr/bin/mysql_config(以mysql_config文件所在机器上的目录为准)


然后 python setup.py install
 
但是这样安装会出现:
ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

[Errno 13] Permission denied: '/root/.cache'

The Python egg cache directory is currently set to:

/root/.cache/Python-Eggs

Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

最后解决办法:
 
首先:apt-get install libmysqlclient-dev
 
然后再 pip install MySQL-python,解决。