无法将 pytorch 安装到我的 anaconda 虚拟环境

Could not install pytorch to my anaconda virtual environment

我正在关注 OpenAI's spinningUp tutorial,但我卡在了项目的安装部分。我正在使用 Anaconda,当我这样做时:

pip install -e .

它给出以下错误:

Obtaining file:///E:/Ege/UNIVERSITY-OF-SUSSEX/Dissertation/OpenAI/spinningup
Collecting cloudpickle==1.2.1
  Using cached cloudpickle-1.2.1-py2.py3-none-any.whl (25 kB)
Collecting gym[atari,box2d,classic_control]~=0.15.3
  Using cached gym-0.15.7.tar.gz (1.6 MB)
Collecting ipython
  Using cached ipython-7.14.0-py3-none-any.whl (782 kB)
Requirement already satisfied: joblib in c:\users\ege\anaconda3\envs\spinningup\lib\site-packages (from spinup==0.2.0) (0.14.1)
Collecting matplotlib==3.1.1
  Using cached matplotlib-3.1.1-cp36-cp36m-win_amd64.whl (9.1 MB)
Collecting mpi4py
  Using cached mpi4py-3.0.3-cp36-cp36m-win_amd64.whl (477 kB)
Requirement already satisfied: numpy in c:\users\ege\anaconda3\envs\spinningup\lib\site-packages (from spinup==0.2.0) (1.18.1)
Collecting pandas
  Using cached pandas-1.0.3-cp36-cp36m-win_amd64.whl (8.7 MB)
Collecting pytest
  Using cached pytest-5.4.2-py3-none-any.whl (247 kB)
Collecting psutil
  Using cached psutil-5.7.0-cp36-cp36m-win_amd64.whl (235 kB)
Requirement already satisfied: scipy in c:\users\ege\anaconda3\envs\spinningup\lib\site-packages (from spinup==0.2.0) (1.4.1)
Collecting seaborn==0.8.1
  Using cached seaborn-0.8.1.tar.gz (178 kB)
Requirement already satisfied: tensorflow<2.0,>=1.8.0 in c:\users\ege\anaconda3\envs\spinningup\lib\site-packages (from spinup==0.2.0) (1.15.0)
ERROR: Could not find a version that satisfies the requirement torch==1.3.1 (from spinup==0.2.0) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch==1.3.1 (from spinup==0.2.0)

我的所有包在环境中都是这些:

# packages in environment at C:\Users\Ege\Anaconda3\envs\spinningup:
#
# Name                    Version                   Build  Channel
_pytorch_select           1.1.0                       cpu
absl-py                   0.9.0                    pypi_0    pypi
astor                     0.8.1                    pypi_0    pypi
blas                      1.0                         mkl
certifi                   2020.4.5.1               py36_0
cffi                      1.14.0           py36h7a1dbc1_0
cudatoolkit               10.2.89              h74a9793_1
freetype                  2.9.1                ha9979f8_1
gast                      0.2.2                    pypi_0    pypi
google-pasta              0.2.0                    pypi_0    pypi
grpcio                    1.29.0                   pypi_0    pypi
h5py                      2.10.0                   pypi_0    pypi
icc_rt                    2019.0.0             h0cc432a_1
importlib-metadata        1.6.0                    pypi_0    pypi
intel-openmp              2020.1                      216
joblib                    0.14.1                     py_0
jpeg                      9b                   hb83a4c4_2
keras-applications        1.0.8                    pypi_0    pypi
keras-preprocessing       1.1.2                    pypi_0    pypi
libpng                    1.6.37               h2a8f88b_0
libtiff                   4.1.0                h56a325e_0
markdown                  3.2.2                    pypi_0    pypi
mkl                       2020.1                      216
mkl-service               2.3.0            py36hb782905_0
mkl_fft                   1.0.15           py36h14836fe_0
mkl_random                1.1.0            py36h675688f_0
ninja                     1.9.0            py36h74a9793_0
numpy                     1.18.1           py36h93ca92e_0
numpy-base                1.18.1           py36hc3f5095_1
olefile                   0.46                     py36_0
opt-einsum                3.2.1                    pypi_0    pypi
pillow                    7.1.2            py36hcc1f983_0
pip                       20.0.2                   py36_3
protobuf                  3.12.0                   pypi_0    pypi
pycparser                 2.20                       py_0
python                    3.6.10               h9f7ef89_2
pytorch-metric-learning   0.9.86             pyh39e3cac_0    metric-learning
pyyaml                    5.3.1                    pypi_0    pypi
scikit-learn              0.22.1           py36h6288b17_0
scipy                     1.4.1            py36h9439919_0
setuptools                46.4.0                   py36_0
six                       1.14.0                   py36_0
sqlite                    3.31.1               h2a8f88b_1
tensorboard               1.15.0                   pypi_0    pypi
tensorflow                1.15.0                   pypi_0    pypi
tensorflow-estimator      1.15.1                   pypi_0    pypi
termcolor                 1.1.0                    pypi_0    pypi
tk                        8.6.8                hfa6e2cd_0
torchvision               0.2.2                      py_3    pytorch
tqdm                      4.46.0                     py_0
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_1
werkzeug                  1.0.1                    pypi_0    pypi
wheel                     0.34.2                   py36_0
wincertstore              0.2              py36h7fe50ca_0
wrapt                     1.12.1                   pypi_0    pypi
xz                        5.2.5                h62dcd97_0
zipp                      3.1.0                    pypi_0    pypi
zlib                      1.2.11               h62dcd97_4
zstd                      1.3.7                h508b16e_0

并且在项目的 requirement.txt 中甚至不需要火炬,因此我假设它更多的是关于 tensorflow:

cloudpickle~=1.2.1
gym~=0.15.3
ipython
joblib
matplotlib
numpy
pandas
pytest
psutil
scipy
seaborn==0.8.1
sphinx==1.5.6
sphinx-autobuild==0.7.1       
sphinx-rtd-theme==0.4.1 
tensorflow>=1.8.0,<2.0
tqdm

我该如何解决这个问题?

pypi 上的

torch==1.3 只有 linux 和 macOS 的文件,请参阅 here

您需要使用火炬网站的索引单独安装它:

pip install torch===1.3.1 -f https://download.pytorch.org/whl/torch_stable.html

之后,再次尝试您的原始安装