記錄本地環境下的安裝包
pip freeze > requirements.txt
從需求檔案中安裝所需包
pip install -r requirements.txt
一行一行的安裝<忽略某些錯誤的安裝>
cat requirements.txt | xargs -n 1 pip install
pip3 安裝SSL module 不可用
下載下傳源碼包,并安裝依賴檔案重新編譯
1.wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tar.xz
下載下傳源碼包,windows下直接下載下傳即可
2.tar zxVf Python-3.6.8.tar.xz
解壓
3.安裝一些依賴
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel <centos下>
4. cd Python-3.6.8 and ./configure
5.make && make install
pip 安裝慢的問題
加入參數 pip install <package > -i https://pypi.tuna.tsinghua.edu.cn/simple(别的也行)
pip(ubuntu16下) 安裝遇到錯誤File “build/bdist.linux-x86_64/egg/OpenSSL/__init__.py”, line 8, in
File “build/bdist.linux-x86_64/egg/OpenSSL/SSL.py”, line 194, in
AttributeError: ‘module’ object has no attribute ‘Cryptography_HAS_SSL_ST’
解決方法:
1.先安裝缺失的依賴包
apt-get install libffi-dev
apt-get install libssl-dev
2.重新安裝pyopenssl
python -m easy_install –upgrade pyOpenSSL