apt-get install software-properties-common
apt-get install python2.7
apt-get install python-pip
python --version
pip install --upgrade pip
pip --version
vim /usr/bin/pip 修改内容
from pip import main
if name == 'main':
sys.exit(main._main())apt-get install python-numpy -y
apt-get install python-scipy -y
apt-get install python-matplotlib -y
apt-get install python-pandas -y
pip install --upgrade numpy scipy matplotlib pandas statsmodels
超时
mkdir ~/.pip
vim ~/.pip/pip.conf 修改pip源
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
切换python版本 python2即将不再支持 且某些包的新版本只支持python3
重新安装pip
apt-get Install python3-pip -y
切换后出现 pip 错误
ModuleNotFoundError: No module named 'apt_pkg'
mv apt_pkg.cpython-36m-x86_64-linux-gnu.so apt_pkg.cpython-37m-x86_64-linux-gnu.so
ModuleNotFoundError: No module named 'pip._internal'
首先执行 python -m ensurepip 然后执行 python -m pip install --upgrade pip 即可更新完毕
pip install --upgrade numpy scipy matplotlib pandas statsmodels
安装scikit-learn
export LC_ALL=c #预防编译错误
pip install scikit-learn
安装tensorFlow Cpu版 | tensorFlow-gpu
apt-get install python-dev
pip install tensorflow
pip install -U protobuf 默认3.7.0的protobuf 无法使用
pip install protobuf==3.6.0