Python環境(基於Pycharm和官方python包)搭建順序

1.下載安裝包
python官網下載3.7.2
Pycharm 社區版下載安裝python

2.直接使用Pycharm自帶virtualEnv
File - Settings - Project - Project Interpreter - (右側的齒輪)Add - Virtualenv enviroment - New Virtualenvide

說說不用Anoconda緣由。
主要是Anoconda到python環境導入到Pycharm時再新增包時,提示SSL鏈接沒法創建。
(
Collecting opencv-python==3.4.2.17
Could not fetch URL https://pypi.org/simple/opencv-python/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/opencv-python/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
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
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.


(緣由沒有SSL模塊支持,Ubuntu下apt-get install openssl解決,但python官網的安裝包默認就有ssl)
因此,Pycharm導入python官網環境後,再新增包時,輕鬆pip install了。
因此若是在Pycharm下管理python環境,就能夠用上述的第2點方法fetch

相關文章
相關標籤/搜索