系統自帶的Python的路徑:
/Library/Frameworks/Python.framework/Versions/2.7
安裝包路徑1:(通過python setup.py install命令安裝的模塊)
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
安裝包路徑2:(使用pip install或easy_install安裝的模塊)
/Library/Python/2.7/site-packages
使用brew安裝路徑:/usr/local (本地用戶的系統文件夾)
使用brew安裝的python路徑:
/usr/local/Frameworks/Python.framework/Versions/
/usr/local/Cellar/python/2.7.13
You can install Python packages with
pip install <package>
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
查看當前使用的python路徑:
$ which python
/usr/bin/python
Python3虛擬環境:
virtualenv -p /usr/bin/python3 py3env
source py3env/bin/activate
使用虛擬環境:
$ pip install requests
退出虛擬環境:
$ deactivate
|
新聞熱點
疑難解答