在windows系統下通過安裝Anaconda的方式安裝的python使用中發現不能再通過pip安裝python包。只能通過conda install packname 的方法,導致很多conda不支持的包無法安裝(我遇到的是 request)
解決方法:打開Anaconde prompt
在該prompt中使用pip而不是命令行或者powershell中使用pip
問題順利解決。
例如:在命令行pip install dlib 報錯
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
在Anaconde prompt 運行 pip install requests 順利安裝完成
Requirement already satisfied: requests in e:\anaconda\lib\site-packages (2.21.0) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in e:\anaconda\lib\site-packages (from requests) (3.0.4) Requirement already satisfied: certifi>=2017.4.17 in e:\anaconda\lib\site-packages (from requests) (2018.11.29) Requirement already satisfied: idna<2.9,>=2.5 in e:\anaconda\lib\site-packages (from requests) (2.8) Requirement already satisfied: urllib3<1.25,>=1.21.1 in e:\anaconda\lib\site-packages (from requests) (1.24.1)