1. 查看Python安装和依赖信息:cmd命令窗口python -m site
E:workspacepythonDjango>python -m site sys.path = [ 'E:\workspace\python\Django', 'D:\Program Files\python\python37.zip', 'D:\Program Files\python\DLLs', 'D:\Program Files\python\lib', 'D:\Program Files\python', 'C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages', 'D:\Program Files\python\lib\site-packages', 'D:\Program Files\python\lib\site-packages\you_get-0.4.1475-py3.7.egg', ] USER_base: 'C:\Users\Administrator\AppData\Roaming\Python' (exists) USER_SITE: 'C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages' (exists) ENABLE_USER_SITE: True
可以看到
- python安装目录
- USER_SITE:自定义Python依赖安装包的基础路径
- USER_base:自定义Python脚本
- 查看依赖配置site.py的路径
python -m site -help # site.py的路径 D:Program Filespythonlibsite.py [--user-base] [--user-site]
- 修改site.py
# USER_SITE = None # USER_base = None USER_SITE = "D:\Program Files\python\Lib\site-packages" USER_base = "D:\Program Files\python\scripts"
注意尽量写到python目录
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)