赞
踩
了解python的安装路径,有利于处对python安装的管理。比如删除多余的python,可以在这些路径中查询处理。
/System/Library/Frameworks/Python.framework/Versions
对应系统 pip 安装的第三方库的安装路径:
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
/Library/Frameworks/Python.framework/Versions/3.x
对应 pip 安装的第三方库的安装路径: ( 比如Django Flask 都是安装在这里 )
Library/Frameworks/Python.framework/Versions/3.x/lib/python3.x/site-packages
/usr/local/Cellar/python@2 //@2 表示python版本,也可以是 @3
homebrew 安装的外部包的安装路径:
/Library/Python
brew install python@3.8
xcrun: error: invalid active developer path (/Applications/Xcode.app/Contents/Developer)
原因:卸载了Xcode或者升级Xcode导致
处理:
sudo xcode-select -r
sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
xcode-select -p
方法一:terminal
python3
>>> import sys
>>> sys.path
打印结果:
['',
'/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python38.zip',
'/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8',
'/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/lib-dynload',
'/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages',
'/Library/Python/3.8/site-packages',
'/Library/Python/3.8/site-packages/Django-4.0.4-py3.8.egg']
方法二:terminal
which python3
方法三:mac版Pycharm第三方库路径
/Library/Python
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。