Install torchtext with pytorch 1.13.1 with cuda 11.7

5.1k Views Asked by At

I currently have PyTorch 1.13.1 with CUDA 11.7 installed and it's working perfectly fine. However, when I try to install TorchText using 'pip install torchtext', it automatically installs PyTorch 2 which causes issues with my existing code that relies on PyTorch 1.13.1 with CUDA 11.7.

When I attempt to install an older version of TorchText, such as 0.14.0, it automatically uninstalls my current version of PyTorch and installs PyTorch 1.13.0 without GPU support.

Is there a way for me to install TorchText without upgrading my PyTorch version and while keeping my CUDA and PyTorch installations intact?

1

There are 1 best solutions below

0
igrinis On

You can try

pip install torchtext==0.14.0 --no-deps

It depends on Pytorch 1.13.0 and you already have 1.13.1 installed so it should work fine.

If it does not work, you will most probably need to downgrade Pytorch

pip3 install -U torch==1.13.0+cu117 torchtext==0.14.0 --extra-index-url https://download.pytorch.org/whl/cu117