2. 編輯 python39._pth:加入 Lib/site-packages 路徑、取消 import site 註解
Lib/site-packages python39.zip . # Uncomment to run site.main() automatically import site3. 安裝 pip 套件工具 python get-pip.py
4. 設定環境變數(Path)
- X:\python3.9
- X:\python3.9\Scripts
5. 測一下 pip 會不會動
> pip list > pip install requests > pip -V pip 20.2.4 from d:\python3.9\lib\site-packages\pip (python 3.9) > pip show pip Name: pip Version: 20.2.4 Summary: The PyPA recommended tool for installing Python packages. Home-page: https://pip.pypa.io/ Author: The pip developers Author-email: distutils-sig@python.org License: MIT Location: d:\python3.9\lib\site-packages
6. 測一下 python 載入套件(import)路徑順序
> python Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['D:\\python3.9\\python39.zip', 'D:\\python3.9', 'D:\\python3.9\\lib\\site-packages']
沒有留言:
張貼留言