当我有另一个具有该版本的 conda 环境时,为什么 pip 不允许我在新的 conda 环境中安装 torch==1.9.1+cu111 ?

2024-03-06

当我在新的 conda 环境中运行 pip install 时:

(base) brando9~ $ pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html

Looking in links: https://download.pytorch.org/whl/torch_stable.html
ERROR: Could not find a version that satisfies the requirement torch==1.9.1+cu111 (from versions: 1.11.0, 1.11.0+cpu, 1.11.0+cu102, 1.11.0+cu113, 1.11.0+cu115, 1.11.0+rocm4.3.1, 1.11.0+rocm4.5.2, 1.12.0, 1.12.0+cpu, 1.12.0+cu102, 1.12.0+cu113, 1.12.0+cu116, 1.12.0+rocm5.0, 1.12.0+rocm5.1.1, 1.12.1, 1.12.1+cpu, 1.12.1+cu102, 1.12.1+cu113, 1.12.1+cu116, 1.12.1+rocm5.0, 1.12.1+rocm5.1.1, 1.13.0, 1.13.0+cpu, 1.13.0+cu116, 1.13.0+cu117, 1.13.0+cu117.with.pypi.cudnn, 1.13.0+rocm5.1.1, 1.13.0+rocm5.2, 1.13.1, 1.13.1+cpu, 1.13.1+cu116, 1.13.1+cu117, 1.13.1+cu117.with.pypi.cudnn, 1.13.1+rocm5.1.1, 1.13.1+rocm5.2)
ERROR: No matching distribution found for torch==1.9.1+cu111

该 pytorch 版本的另一个环境:

(metalearning3.9) [pzy2@vision-submit ~]$ pip list
Package                            Version              Location
---------------------------------- -------------------- ------------------
absl-py                            1.0.0
aiohttp                            3.8.3
aiosignal                          1.3.1
alabaster                          0.7.12
anaconda-client                    1.9.0
anaconda-project                   0.10.1
antlr4-python3-runtime             4.8
anyio                              2.2.0
appdirs                            1.4.4
argcomplete                        2.0.0
argh                               0.26.2
argon2-cffi                        20.1.0
arrow                              0.13.1
asn1crypto                         1.4.0
astroid                            2.6.6
astropy                            4.3.1
asttokens                          2.0.7
astunparse                         1.6.3
async-generator                    1.10
async-timeout                      4.0.2
atomicwrites                       1.4.0
attrs                              21.2.0
autopep8                           1.5.7
Babel                              2.9.1
backcall                           0.2.0
backports.shutil-get-terminal-size 1.0.0
beautifulsoup4                     4.10.0
binaryornot                        0.4.4
bitarray                           2.3.0
bkcharts                           0.2
black                              19.10b0
bleach                             4.0.0
bokeh                              2.4.1
boto                               2.49.0
Bottleneck                         1.3.2
brotlipy                           0.7.0
cached-property                    1.5.2
cachetools                         5.0.0
certifi                            2021.10.8
cffi                               1.14.6
chardet                            4.0.0
charset-normalizer                 2.0.4
cherry-rl                          0.1.4
click                              8.0.3
cloudpickle                        2.0.0
clyent                             1.2.2
colorama                           0.4.4
conda                              4.12.0
conda-content-trust                0+unknown
conda-pack                         0.6.0
conda-package-handling             1.8.0
conda-token                        0.3.0
configparser                       5.3.0
contextlib2                        0.6.0.post1
cookiecutter                       1.7.2
crc32c                             2.3
crcmod                             1.7
cryptography                       3.4.8
cycler                             0.10.0
Cython                             0.29.24
cytoolz                            0.11.0
daal4py                            2021.3.0
dask                               2021.10.0
debugpy                            1.4.1
decorator                          5.1.0
defusedxml                         0.7.1
diff-match-patch                   20200713
dill                               0.3.4
distributed                        2021.10.0
docker-pycreds                     0.4.0
docutils                           0.17.1
entrypoints                        0.3
et-xmlfile                         1.1.0
executing                          0.9.1
fairseq                            0.12.2               /home/pzy2/fairseq
fastcache                          1.1.0
fastcluster                        1.2.6
fasteners                          0.17.3
filelock                           3.3.1
flake8                             3.9.2
Flask                              1.1.2
flatbuffers                        2.0.7
fonttools                          4.25.0
frozenlist                         1.3.0
fsspec                             2021.8.1
gast                               0.4.0
gcs-oauth2-boto-plugin             3.0
gevent                             21.8.0
gitdb                              4.0.9
GitPython                          3.1.27
glob2                              0.7
gmpy2                              2.0.8
google-apitools                    0.5.32
google-auth                        2.6.3
google-auth-oauthlib               0.4.6
google-pasta                       0.2.0
google-reauth                      0.1.1
gql                                0.2.0
graphql-core                       1.1
greenlet                           1.1.1
grpcio                             1.44.0
gsutil                             5.9
gym                                0.22.0
gym-notices                        0.0.6
h5py                               3.3.0
HeapDict                           1.0.1
higher                             0.2.1
html5lib                           1.1
httplib2                           0.20.4
huggingface-hub                    0.5.1
hydra-core                         1.0.7
idna                               3.2
imagecodecs                        2021.8.26
imageio                            2.9.0
imagesize                          1.2.0
importlib-metadata                 4.12.0
inflection                         0.5.1
iniconfig                          1.1.1
intervaltree                       3.1.0
ipykernel                          6.4.1
ipython                            7.29.0
ipython-genutils                   0.2.0
ipywidgets                         7.6.5
isort                              5.9.3
itsdangerous                       2.0.1
jdcal                              1.4.1
jedi                               0.18.0
jeepney                            0.7.1
Jinja2                             2.11.3
jinja2-time                        0.2.0
joblib                             1.1.0
json5                              0.9.6
jsonschema                         3.2.0
jupyter                            1.0.0
jupyter-client                     6.1.12
jupyter-console                    6.4.0
jupyter-core                       4.8.1
jupyter-server                     1.4.1
jupyterlab                         3.2.1
jupyterlab-pygments                0.1.2
jupyterlab-server                  2.8.2
jupyterlab-widgets                 1.0.0
keras                              2.10.0
Keras-Preprocessing                1.1.2
keyring                            23.1.0
kiwisolver                         1.3.1
lark-parser                        0.12.0
lazy-object-proxy                  1.6.0
learn2learn                        0.1.7
libarchive-c                       2.9
libclang                           14.0.6
littleutils                        0.2.2
llvmlite                           0.37.0
locket                             0.2.1
loguru                             0.6.0
lxml                               4.6.3
Markdown                           3.3.6
MarkupSafe                         1.1.1
matplotlib                         3.4.3
matplotlib-inline                  0.1.2
mccabe                             0.6.1
mistune                            0.8.4
mkl-fft                            1.3.1
mkl-random                         1.2.2
mkl-service                        2.4.0
mock                               4.0.3
monotonic                          1.6
more-itertools                     8.10.0
mpmath                             1.2.1
msgpack                            1.0.2
multidict                          6.0.2
multipledispatch                   0.6.0
munkres                            1.1.4
mypy-extensions                    0.4.3
nbclassic                          0.2.6
nbclient                           0.5.3
nbconvert                          6.1.0
nbformat                           5.1.3
nest-asyncio                       1.5.1
networkx                           2.6.3
nltk                               3.6.5
nose                               1.3.7
notebook                           6.4.5
numba                              0.54.1
numexpr                            2.7.3
numpy                              1.20.3
numpydoc                           1.1.0
nvidia-ml-py3                      7.352.0
nvidia-smi                         0.1.3
oauth2client                       4.1.3
oauthlib                           3.2.0
olefile                            0.46
omegaconf                          2.0.6
opencv-python                      4.6.0.66
openpyxl                           3.0.9
opt-einsum                         3.3.0
ordered-set                        4.1.0
packaging                          21.0
pandas                             1.3.4
pandocfilters                      1.4.3
parso                              0.8.2
partd                              1.2.0
path                               16.0.0
pathlib2                           2.3.6
pathspec                           0.7.0
pathtools                          0.1.2
patsy                              0.5.2
pep8                               1.7.1
pexpect                            4.8.0
pickleshare                        0.7.5
Pillow                             8.4.0
pip                                22.2.2
pkginfo                            1.7.1
plotly                             5.7.0
pluggy                             0.13.1
ply                                3.11
portalocker                        2.5.1
poyo                               0.5.0
progressbar2                       4.0.0
prometheus-client                  0.11.0
promise                            2.3
prompt-toolkit                     3.0.20
protobuf                           3.19.6
psutil                             5.8.0
ptyprocess                         0.7.0
py                                 1.10.0
pyasn1                             0.4.8
pyasn1-modules                     0.2.8
pycodestyle                        2.7.0
pycosat                            0.6.3
pycparser                          2.20
pycurl                             7.44.1
pydocstyle                         6.1.1
pyerfa                             2.0.0
pyflakes                           2.3.1
Pygments                           2.10.0
pylint                             2.9.6
pyls-spyder                        0.4.0
pyodbc                             4.0.0-unsupported
pyOpenSSL                          21.0.0
pyparsing                          3.0.4
pyrsistent                         0.18.0
PySocks                            1.7.1
pytest                             6.2.4
python-dateutil                    2.8.2
python-lsp-black                   1.0.0
python-lsp-jsonrpc                 1.0.0
python-lsp-server                  1.2.4
python-slugify                     5.0.2
python-utils                       3.1.0
pytz                               2021.3
pyu2f                              0.1.5
PyWavelets                         1.1.1
pyxdg                              0.27
PyYAML                             6.0
pyzmq                              22.2.1
QDarkStyle                         3.0.2
qpth                               0.0.15
qstylizer                          0.1.10
QtAwesome                          1.0.2
qtconsole                          5.1.1
QtPy                               1.10.0
regex                              2021.8.3
requests                           2.26.0
requests-oauthlib                  1.3.1
retry-decorator                    1.1.1
rope                               0.19.0
rsa                                4.7.2
Rtree                              0.9.7
ruamel-yaml-conda                  0.15.100
sacrebleu                          2.2.0
sacremoses                         0.0.49
scikit-image                       0.18.3
scikit-learn                       0.24.2
scikit-learn-intelex               2021.20210714.170444
scipy                              1.7.1
seaborn                            0.11.2
SecretStorage                      3.3.1
Send2Trash                         1.8.0
sentry-sdk                         1.5.9
setproctitle                       1.2.2
setuptools                         58.0.4
shortuuid                          1.0.8
simplegeneric                      0.8.1
singledispatch                     3.7.0
sip                                4.19.13
six                                1.16.0
sklearn                            0.0
smmap                              5.0.0
sniffio                            1.2.0
snowballstemmer                    2.1.0
sorcery                            0.2.2
sortedcollections                  2.1.0
sortedcontainers                   2.4.0
soupsieve                          2.2.1
Sphinx                             4.2.0
sphinxcontrib-applehelp            1.0.2
sphinxcontrib-devhelp              1.0.2
sphinxcontrib-htmlhelp             2.0.0
sphinxcontrib-jsmath               1.0.1
sphinxcontrib-qthelp               1.0.3
sphinxcontrib-serializinghtml      1.1.5
sphinxcontrib-websupport           1.2.4
spyder                             5.1.5
spyder-kernels                     2.1.3
SQLAlchemy                         1.4.22
statsmodels                        0.12.2
subprocess32                       3.5.4
sympy                              1.9
tables                             3.6.1
TBB                                0.2
tblib                              1.7.0
tensorboard                        2.10.1
tensorboard-data-server            0.6.1
tensorboard-plugin-wit             1.8.1
tensorflow-estimator               2.10.0
tensorflow-gpu                     2.10.1
tensorflow-io-gcs-filesystem       0.27.0
termcolor                          2.0.1
terminado                          0.9.4
testpath                           0.5.0
text-unidecode                     1.3
textdistance                       4.2.1
tfrecord                           1.14.1
threadpoolctl                      2.2.0
three-merge                        0.1.1
tifffile                           2021.7.2
timm                               0.6.11
tinycss                            0.4
tokenizers                         0.11.6
toml                               0.10.2
toolz                              0.11.1
torch                              1.9.1+cu111
torchaudio                         0.9.1
torchmeta                          1.8.0
torchtext                          0.10.1
torchvision                        0.10.1+cu111
tornado                            6.1
tqdm                               4.62.3
traitlets                          5.1.0
transformers                       4.18.0
typed-ast                          1.4.3
typing-extensions                  3.10.0.2
ujson                              4.0.2
ultimate-anatome                   0.1.1
ultimate-aws-cv-task2vec           0.0.1
unicodecsv                         0.14.1
Unidecode                          1.2.0
urllib3                            1.26.7
wandb                              0.13.5
watchdog                           2.1.3
wcwidth                            0.2.5
webencodings                       0.5.1
Werkzeug                           2.0.2
wheel                              0.37.0
whichcraft                         0.6.1
widgetsnbextension                 3.5.1
wrapt                              1.12.1
wurlitzer                          2.1.1
xlrd                               2.0.1
XlsxWriter                         3.0.1
xlwt                               1.3.0
yapf                               0.31.0
yarl                               1.7.2
zict                               2.0.0
zipp                               3.6.0
zope.event                         4.5.0
zope.interface                     5.4.0
WARNING: You are using pip version 22.2.2; however, version 22.3.1 is available.
You should consider upgrading via the '/home/pzy2/miniconda3/envs/metalearning3.9/bin/python -m pip install --upgrade pip' command.
(metalearning3.9) [pzy2@vision-submit ~]$

我问了一个相关的问题,因为我无法使用 conda 和 cuda 安装 pytorch,请参阅此处的详细信息:尽管我明确下载了 cuda 工具包版本,为什么 conda 仍安装 pytorch CPU 版本? https://stackoverflow.com/questions/75023120/why-does-conda-install-the-pytorch-cpu-version-despite-me-putting-explicitly-to


我认为这有效:

# -- Install PyTorch sometimes requires more careful versioning due to cuda, ref: official install instruction https://pytorch.org/get-started/previous-versions/
# you need python 3.9 for torch version 1.9.1 to work, due to torchmeta==1.8.0 requirement
if ! python -V 2>&1 | grep -q 'Python 3\.9'; then
    echo "Error: Python 3.9 is required!"
    exit 1
fi

pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html

通过查看您提供的链接,我可以看到

cu111/torch-1.9.1%2Bcu111-cp36-cp36m-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp36-cp36m-win_amd64.whl
cu111/torch-1.9.1%2Bcu111-cp37-cp37m-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp37-cp37m-win_amd64.whl
cu111/torch-1.9.1%2Bcu111-cp38-cp38-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp38-cp38-win_amd64.whl
cu111/torch-1.9.1%2Bcu111-cp39-cp39-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp39-cp39-win_amd64.whl

cp39 表示 Python 版本 3.9。请注意,不支持 3.10 或 3.11。在新环境中,您可能正在运行较新版本的 Python,而在其他环境中,您运行的是 Python 3.6、3.7、3.8 或 3.9

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

当我有另一个具有该版本的 conda 环境时,为什么 pip 不允许我在新的 conda 环境中安装 torch==1.9.1+cu111 ? 的相关文章

  • 使用Python的工业视觉相机[关闭]

    就目前情况而言 这个问题不太适合我们的问答形式 我们希望答案得到事实 参考资料或专业知识的支持 但这个问题可能会引发辩论 争论 民意调查或扩展讨论 如果您觉得这个问题可以改进并可能重新开放 访问帮助中心 help reopen questi
  • 在 python 2 和 3 的spyder之间切换

    根据我在文档中了解到的内容 它指出您只需使用命令提示符创建一个新变量即可轻松在 2 个 python 环境之间切换 如果我已经安装了 python 2 7 则 conda create n python34 python 3 4 anaco
  • 如何在groupby之后将pandas数据框拆分为许多列

    我希望能够在 pandas 中使用 groupby 按列对数据进行分组 然后将其拆分 以便每个组都是数据框中自己的列 e g time data 0 1 2 0 1 2 3 0 2 3 4 0 3 1 2 1 4 2 3 1 5 3 4 1
  • 如何在算术表达式的结果上添加 SQLAlchemy 标签?

    我如何将这样的东西翻译成 SQLAlchemy select x y as difference 我知道该怎么做 x label foo 但我不确定在哪里放置下面的 label 方法调用 select table c x table c y
  • 远程控制或脚本打开 Office 从 Python 编辑 Word 文档

    我想 最好在 Windows 上 在特定文档上启动 Open Office 搜索固定字符串并将其替换为我的程序选择的另一个字符串 我该如何从外部 Python 程序中做到这一点 OLE 什么 原生 Python 脚本解决方案 The doc
  • 如何在 openpyxl 中设置或更改表格的默认高度

    我想通过openpyxl更改表格高度 并且我希望首先默认一个更大的高度值 然后我可以设置自动换行以使我的表格更漂亮 但我不知道如何更改默认高度 唯一的到目前为止 我知道更改表格高度的方法是设置 row dimension idx heigh
  • 使用 Python 抓取维基百科数据

    我正在尝试从以下内容中检索 3 列 NFL 球队 球员姓名 大学球队 维基百科页面 http en wikipedia org wiki 2008 NFL draft 我是 python 新手 一直在尝试使用 beautifulsoup 来
  • 以编程方式将列名称添加到 numpy ndarray

    我正在尝试将列名称添加到 numpy ndarray 然后按名称选择列 但这不起作用 我无法判断问题是在添加名称时出现 还是在稍后尝试调用它们时出现 这是我的代码 data np genfromtxt csv file delimiter
  • 如何使用注释和聚合在 Django 的 ORM 中执行此 GROUP BY 查询

    我真的不知道如何翻译GROUP BY and HAVING到姜戈的QuerySet annotate and QuerySet aggregate 我正在尝试将这个 SQL 查询转换为 ORM 语言 SELECT EXTRACT year
  • 将具有不同大小的行的数据加载到 Numpy 数组中

    假设我有一个包含如下数据的文本文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 如何将它加载到 numpy 数组中 使其看起来像这样 1 2 3 4 5 0 6 7 8 0 0 0 9 1
  • 在 Python 中,如何获取特定文件中定义的类列表?

    如果一个文件myfile py包含 class A object Some implementation class B object Some implementation 我如何定义一个方法 以便在给定的情况下myfile py 它返回
  • 与函数复合 UniqueConstraint

    一个快速的 SQLAlchemy 问题 我有一个 文档 类 其属性为 数字 和 日期 我需要确保没有重复的号码同年 是 有没有办法对 数字 年份 日期 进行UniqueConstraint 我应该使用唯一索引吗 我如何声明功能部分 SQLA
  • 使用 pandas 绘制带有误差线的条形图

    我正在尝试从 DataFrame 生成条形图 如下所示 Pre Post Measure1 0 4 1 9 这些值是我从其他地方计算出来的中值 我还有它们的方差和标准差 以及标准误差 我想将结果绘制为具有适当误差线的条形图 但指定多个误差值
  • 本地设置的 Cython 编译器指令是否影响一个或所有函数?

    我正在努力使用 Cython 加速一些 Python Numpy 代码 并且对 本地 设置 如定义的here http docs cython org en latest src reference compilation html在文档中
  • scrapy python 请求未定义

    我在这里找到了答案 code for site in sites Link site xpath a href extract CompleteLink urlparse urljoin response url Link yield Re
  • Melt() 函数复制数据集

    我有一个这样的表 id name doggo floofer puppo pupper 1 rowa NaN NaN NaN NaN 2 ray NaN NaN NaN NaN 3 emma NaN NaN NaN pupper 4 sop
  • 使用Python重命名目录中的多个文件

    我正在尝试使用以下 Python 脚本重命名目录中的多个文件 import os path Users myName Desktop directory files os listdir path i 1 for file in files
  • Python 中的迭代器 (iter()) 函数。 [关闭]

    Closed 这个问题是无法重现或由拼写错误引起 help closed questions 目前不接受答案 对于字典 我可以使用iter 用于迭代字典的键 y x 10 y 20 for val in iter y print val 当
  • 如何抑制 Pandas Future 警告?

    当我运行该程序时 Pandas 每次都会给出如下所示的 未来警告 D Python lib site packages pandas core frame py 3581 FutureWarning rename with inplace
  • 从 Flask 中的 S3 返回 PDF

    我正在尝试在 Flask 应用程序的浏览器中返回 PDF 我使用 AWS S3 来存储文件 并使用 boto3 作为与 S3 交互的 SDK 到目前为止我的代码是 s3 boto3 resource s3 aws access key id

随机推荐