但是!!!
建立了環境之後直接用pip安裝新的包,還是沒有權限的!!!!
因爲conda新建的環境裏沒有pip,其實用的還是系統自帶的pip,所以沒有權限。
所以正確的虛擬環境建立方法是這樣的!【anaconda3版本:4.4.0 】
下載anaconda
wget https://repo.continuum.io/archive/Anaconda3-4.4.0-Linux-x86_64.sh
安裝anaconda:bash Anaconda3-4.4.0-Linux-x86_64.sh
新建conda環境:
conda create -n my_environment
進入conda'環境:
source activate my_environment
重點來了!在新的虛擬環境裏!安裝一次pip!:
conda install pip
然後就可以隨意地pip安裝啦。
附:一定能安裝成功的tensorflow安裝方法:
上面的安裝好後:
安裝python3.6.0:
conda install python=3.5.0
安裝tensorflow 1.2 帶GPU支持:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.2.0-cp36-cp36m-linux_x86_64.whl
如果失敗,請用以下指令,安裝無GPU支持版:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.0-cp36-cp36m-linux_x86_64.whl
即可。
參考回答: