我试图安装火炬使用康达,然而,它安装到另一个康达环境,而不是一个我感兴趣的。我怎么才能解决这个问题?
[jalal@goku NAACL2018]$ conda install pytorch torchvision -c pytorch
Solving environment: done
## Package Plan ##
environment location: /scratch/sjn/anaconda
added / updated specs:
- pytorch
- torchvision
The following packages will be downloaded:
package | build
---------------------------|-----------------
pytorch-0.4.1 |py27__9.0.176_7.1.2_2 471.4 MB pytorch
openssl-1.0.2p | h470a237_1 3.1 MB conda-forge
ca-certificates-2018.10.15 | ha4d7672_0 135 KB conda-forge
conda-4.5.11 | py27_1000 651 KB conda-forge
torchvision-0.2.1 | py27_1 123 KB pytorch
------------------------------------------------------------
Total: 475.4 MB
The following packages will be UPDATED:
ca-certificates: 2018.8.24-ha4d7672_0 conda-forge --> 2018.10.15-ha4d7672_0 conda-forge
conda: 4.5.11-py27_0 conda-forge --> 4.5.11-py27_1000 conda-forge
openssl: 1.0.2p-h470a237_0 conda-forge --> 1.0.2p-h470a237_1 conda-forge
pytorch: 0.4.0-py27hd73e86b_0 --> 0.4.1-py27__9.0.176_7.1.2_2 pytorch
torchvision: 0.2.1-py27_0 conda-forge --> 0.2.1-py27_1 pytorch
Proceed ([y]/n)? y
Downloading and Extracting Packages
pytorch-0.4.1 | 471.4 MB | ##################################### | 100%
openssl-1.0.2p | 3.1 MB | ##################################### | 100%
ca-certificates-2018 | 135 KB | ##################################### | 100%
conda-4.5.11 | 651 KB | ##################################### | 100%
torchvision-0.2.1 | 123 KB | ##################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
[jalal@goku NAACL2018]$ python
Python 3.6.4 |Anaconda custom (64-bit)| (default, Jan 16 2018, 18:10:19)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'torch'
>>> quit()
[jalal@goku NAACL2018]$ conda install pytorch torchvision -c pytorch
Solving environment: done
# All requested packages already installed.
[jalal@goku NAACL2018]$ which conda
/scratch/sjn-p3/anaconda/anaconda3/bin/conda我怎么能强迫它不在environment location: /scratch/sjn/anaconda中安装呢?我希望它能安装在/scratch/sjn-p3/anaconda/anaconda3/bin/conda中的python
发布于 2018-10-19 13:33:22
您可以使用-n或--name标志conda install安装到特定环境中。例如,
$ conda install --name myenv pytorch torchvision -c pytorch发布于 2018-12-23 00:10:48
您有两个选项,但我注意到,您的两个位置不是环境,而是anaconda安装。使用环境时,该位置位于安装的env/目录中。
如果两者都是真正的环境,则可以:
conda activate anaconda3 conda install pytorch torchvision -c pytorchconda install -n anaconda3 pytorch torchvision -c pytorchhttps://askubuntu.com/questions/1084926
复制相似问题