如何在linux下安装pip install torch==2.1.2+cu118?

问题描述 投票:0回答:1

我看到有些人可以安装

pip install torch==2.1.2+cu118
例如:

https://github.com/stanfordnlp/dspy/discussions/818

aiohttp==3.9.3
aioprometheus==23.12.0
aiosignal==1.3.1
alembic==1.13.1
annotated-types==0.6.0
anyio==4.3.0
attrs==23.2.0
backoff==2.2.1
certifi==2024.2.2
charset-normalizer==3.3.2
click==8.1.7
cloudpickle==3.0.0
colorlog==6.8.2
datasets==2.14.7
dill==0.3.7
diskcache==5.6.3
distro==1.9.0
dspy-ai==2.4.0
fastapi==0.110.0
filelock==3.13.1
frozenlist==1.4.1
fsspec==2023.10.0
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.4
httptools==0.6.1
httpx==0.27.0
huggingface-hub==0.21.4
idna==3.6
interegular==0.3.3
Jinja2==3.1.3
joblib==1.3.2
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
lark==1.1.9
llvmlite==0.42.0
Mako==1.3.2
MarkupSafe==2.1.5
mpmath==1.3.0
msgpack==1.0.8
multidict==6.0.5
multiprocess==0.70.15
nest-asyncio==1.6.0
networkx==3.2.1
ninja==1.11.1.1
numba==0.59.0
numpy==1.26.4
nvidia-cublas-cu12==12.1.3.1
nvidia-cuda-cupti-cu12==12.1.105
nvidia-cuda-nvrtc-cu12==12.1.105
nvidia-cuda-runtime-cu12==12.1.105
nvidia-cudnn-cu12==8.9.2.26
nvidia-cufft-cu12==11.0.2.54
nvidia-curand-cu12==10.3.2.106
nvidia-cusolver-cu12==11.4.5.107
nvidia-cusparse-cu12==12.1.0.106
nvidia-nccl-cu12==2.18.1
nvidia-nvjitlink-cu12==12.4.99
nvidia-nvtx-cu12==12.1.105
openai==1.14.1
optuna==3.6.0
orjson==3.9.15
outlines==0.0.30
packaging==24.0
pandas==2.2.1
pillow==10.2.0
plumbum==1.8.2
protobuf==5.26.0
psutil==5.9.8
pyarrow==15.0.2
pyarrow-hotfix==0.6
pydantic==2.5.0
pydantic_core==2.14.1
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pytz==2024.1
PyYAML==6.0.1
pyzmq==25.1.2
quantile-python==1.1
ray==2.9.3
referencing==0.34.0
regex==2023.12.25
requests==2.31.0
rpds-py==0.18.0
rpyc==6.0.0
safetensors==0.4.2
scipy==1.12.0
sentencepiece==0.2.0
sglang==0.1.12
six==1.16.0
sniffio==1.3.1
SQLAlchemy==2.0.28
starlette==0.36.3
sympy==1.12
tokenizers==0.15.2
torch==2.1.2+cu118
tqdm==4.66.2
transformers==4.38.2
triton==2.1.0
typing_extensions==4.10.0
tzdata==2024.1
ujson==5.9.0
urllib3==2.2.1
uvicorn==0.28.0
uvloop==0.19.0
vllm @ https://github.com/vllm-project/vllm/releases/download/v0.2.6/vllm-0.2.6+cu118-cp311-cp311-manylinux1_x86_64.whl#sha256=5306437fe5e59d91b705760b82b0e5be91f05c1b92c5b05e29fb8e1bbb6fe577
watchfiles==0.21.0
websockets==12.0
xformers==0.0.23.post1+cu118
xxhash==3.4.1
yarl==1.9.4
zmq==0.0.0

为什么我不能?我知道它说我做不到:

nload/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver.
(base) brando9@mercury1~/snap-cluster-setup $ pip install torch==2.1.2+cu118
ERROR: Could not find a version that satisfies the requirement torch==2.1.2+cu118 (from versions: 1.13.0, 1.13.1, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2)
ERROR: No matching distribution found for torch==2.1.2+cu118

我知道这是可能的。我的问题是什么?

此命令也失败:

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

pytorch cuda huggingface-transformers dspy vllm
1个回答
0
投票

您尝试使用 pip 执行的命令失败,因为支持 CUDA 11.8 的特定版本的 PyTorch 可能无法直接通过 pip 使用。相反,建议使用 conda 来安装具有特定 CUDA 版本的 PyTorch。

conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=11.8 -c pytorch -c nvidia
© www.soinside.com 2019 - 2024. All rights reserved.