python包管理——python venv和pycharm
python包管理
·
1. python venv
配置默认包安装位置
# python3 -m site -help
/usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site.py
# vim /usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site.py
ENABLE_USER_SITE = True
USER_SITE = "/Users/jackyue/python3/python_venv/lib/python3.9/site-packages"
USER_BASE = "/Users/jackyue/python3/python_venv"
# python3 -m site
USER_BASE: '/Users/jackyue/python3/python_venv' (exists)
USER_SITE: '/Users/jackyue/python3/python_venv/lib/python3.9/site-packages' (exists)
ENABLE_USER_SITE: True
激活虚拟环境,查看默认包安装位置。
# source /Users/jackyue/python3/python_venv/bin/activate
# pip3 -V
pip 23.0.1 from /Users/jackyue/python3/python_venv/lib/python3.9/site-packages/pip (python 3.9)
2. pycharm
在ide里,配置python解释器和python虚拟环境文件夹(如配置/User/jack/python3/python_venv,那么路径下应该没有python_venv文件夹),然后在pycharm的setting中安装包依赖。
更多推荐
已为社区贡献1条内容
所有评论(0)