1. 程式人生 > 其它 >在Ubuntu伺服器上跑python 程式

在Ubuntu伺服器上跑python 程式

技術標籤:伺服器pythonpythonubuntuanacondalinux

1、安裝 Anaconda3
bash Anaconda3-5.3.1-Linux-x86_64.sh

然後一直yes就行了安裝Anaconda3完成

2、配置Anaconda3環境
sudo vim /home/你的使用者名稱/.bashrc

#在最下面加上這一行並儲存
export PATH=/home/你的使用者名稱/anaconda3/bin:$PATH

source /home/你的使用者名稱/.bashrc

配置Anaconda3環境成功

3、建立虛擬環境
conda create -n 環境名 python=3.7
4、啟用虛擬環境
source activate 環境名
5、在虛擬環境中安裝包(以pytorch和skimage為例)
conda install pytorch=0.4.0
pip install scikit-image
6、在自定義虛擬環境中執行程式