1、創(chuàng)建之前確保已經(jīng)安裝了anaconda。
2、在linux系統(tǒng)終端(也可以在pycharm中的終端下)輸入conda指令,進入conda環(huán)境。
conda
?
?3、使用指令conda create --name 環(huán)境名稱 python==3.6 創(chuàng)建自己想要創(chuàng)建的環(huán)境(環(huán)境名稱自己命名)。
conda create --name 環(huán)境名稱 python==3.6
?4、顯示如下,輸入y繼續(xù)。
?5、輸入conda env list 顯示虛擬環(huán)境列表,可以看到自己剛才創(chuàng)建好的環(huán)境以及路徑。
conda env list
?
?6、打開pycharm,點擊右下角當(dāng)前解釋器(python3.x)。
?7、點擊Add Interpreter... 。?
8、選擇Existing environment,點擊后邊的三個點。
?9、根據(jù)剛才查到的路徑找到自己創(chuàng)建的環(huán)境名稱,點進去找到python.exe文件,最后點擊“OK”即可。
?10、在pycharm的終端中輸入conda activate 環(huán)境名稱 進入自己創(chuàng)建的環(huán)境,這時前邊的base已經(jīng)更改為自己創(chuàng)建的環(huán)境名稱。
conda activate 環(huán)境名稱
文章來源:http://www.zghlxwxcb.cn/news/detail-474693.html
?11、最后就可以使用pip指令安裝自己需要的包啦。文章來源地址http://www.zghlxwxcb.cn/news/detail-474693.html
到了這里,關(guān)于Linux下使用anaconda創(chuàng)建python虛擬環(huán)境的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!