1. 程式人生 > >python簡說(十六)第三方模組安裝

python簡說(十六)第三方模組安裝

安裝第三模組

1、pip install xxx
pip問題
1、提示沒有pip命令的,
把python的安裝目錄、
安裝目錄下面的scripts目錄加入到環境變數裡面
2、Unknown or unsupported command 'install'
1、先執行 where pip
2、找到不是python目錄下叫pip的檔案,改成其他的名字就ok了
3、電腦裡面裝了多個python
python2 python3
1、先去python2安裝目錄裡面把python.exe的名字改成python2.exe
2、再把python3安裝目錄裡面的python.exe名字改成python3.exe
python2 -m pip install xxx
python3 -m pip install xxx

2、手動安裝
1、.whl
pip install /Users/nhy/Downloads/PyMySQL-0.9.2-py2.py3-none-any.whl
2、.tar.gz
先解壓
然後在命令列裡面進入到這個目錄下
python setup.py install