在服务器上
python --version
显示是python2.7.5
但是用
pip install statsmodels
以后,会被安装到/usr/lib/python3.6/site-packages
下,
查了一下
https://stackoverflow.com/questions/2812520/pip-dealing-with-multiple-python-versions
最高赞的答案是
The current recommendation is to use python -m pip, where python is the version of Python you would like to use. This is the recommendation because it works across all versions of Python, and in all forms of virtualenv. For example:
# The system default python:
$ python -m pip install fish
# A virtualenv's python:
$ .env/bin/python -m pip install fish
# A specific version of python:
$ python-3.6 -m pip install fish
然后我用
python -m pip install statsmodels
python -m pip install scipy
就把它安装好了