一、安裝Anaconda
解決anaconda安裝時候報錯
win10 環境安裝的anaconda3,在通過pycharm導入虛擬環境或者執行conda更新命令的時候出現ssl錯誤報錯如下:
Collecting package metadata (current_repodata.json): failed CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/current_repodata.json> Elapsed: - An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get you on your way. SSLError(MaxRetryError('HTTPSConnectionPool(host=\'mirrors.tuna.tsinghua.edu.cn\', port=443): Max retries exceeded with url: /anaconda/pkgs/free/win-64/current_repodata.json (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))'))
解決方法:
Try copying these files from Anaconda3/Library/bin to Anaconda3/DLLs : libcrypto-1_1-x64.dll libssl-1_1-x64.dll
翻譯過來就是:
把路徑“Anaconda3/Library/bin ”下面的文件復制到路徑“Anaconda3/DLLs”下 : libcrypto-1_1-x64.dll libssl-1_1-x64.dll
二、安裝vscode
三、在vscode中設置虛擬環境
Ctrl+shift+P打開首選項,設置虛擬環境
將pythonPath改為虛擬環境的路徑,例如我的虛擬環境名稱為“tensorflow”
"python.pythonPath": "D:\\Anaconda3\\envs\\tensorflow"
"python.pythonPath":
"D:
\\
Anaconda3
\\
envs
\\
tensorflow"