安装依赖:
sudo apt-get install libpq-dev python-dev
apt-get install build-essential
apt-get install libtool
错误一:
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/usr/local/lib/python2.7/dist-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)
解决:修改 /usr/local/lib/python2.7/dist-packages/packaging/requirements.py
#MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
MARKER_EXPR = originalTextFor(MARKER_EXPR)("marker")
错误二:
pip install -r requirements.txt 安装mysqldb失败 解决方案
在pip.log中出现sh: 1: mysql_config: not found等一坨报错,因为没有安装另一个包:
只要原因是没有安装:libmysqlclient-dev
sudo apt-get install libmysqlclient-dev
sudo updatedb
这样再pip就可以了。
如果需要找mysql_config文件的路径
locate mysql_config
mysql_config的位置为:/usr/bin/mysql_config
错误三:
安装scipy 出现 MemoryError
pip --no-cache-dir install scipy
错误四:源码安装nginx (编译时)
./configure --without-http_rewrite_module
简便安装redis:
Sudo apt-get install redis-server