I tried to install pytorch in pipenv with the following code:
pipenv install torch===1.4.0 torchvision===0.5.0 -f https://download.pytorch.org/whl/torch_stable.html
but always get the following Error:
ERROR: Could not find a version that satisfies the requirement torch===1.4.0 (from versions: none)
ERROR: No matching distribution found for torch===1.4.0
I also tried it with the following command:
pipenv install https://download.pytorch.org/whl/cu90/torch-1.1.0-cp37-cp37m-win_amd64.whl
but this leads to the following Error message:
ERROR: torch-1.1.0-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
Thanks for your help!
If you just want to install pytorch with CPU version, you can simply try pipenv install torch torchvision torchaudio, which is fine.
If you want to install pytorch with a specified CUDA version, for example CUDA 11.6, you can turn to pipenv run pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116.
Related
I tried my best to install Pytorch but each and every time I failed to install it.
Conda version: 4.6.14
I have used Preview(Nightly) and LTS versions to install but for both of times I have faced the same error like Solving environment: | Killed .
Preview(Nightly) command: conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch-nightly
LTS command: conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch-lts
Faced error is given in the attached file, please check it.
have you tried installing pytorch into a new environment? problems usually arise when you try to install it into your base environment.
conda create -n (NameOfEnviroment) -c pytorch pytorch torchvision
conda update --all
I've been trying to install the Pytorch module for my Ubuntu 16.04 LTS through conda. I used conda install pytorch torchvision cpuonly -c pytorch to install it (non CUDA version). However when I type import torch on the Python shell, this is what I see -
ImportError: /home/student/anaconda2/lib/python2.7/site-packages/torch/_C.so: object file has no loadable segments
I have verified that Pytorch was installed using conda list
I had the same issue on Ubuntu 18.04 for conda env with python 3.8. The problem I think is for the incomplete torch installation. So I did pip install from wheel instead of conda install. You may follow as below (assuming you have cuda11 installed):
create conda env
conda create --name=myenv python=3.8
conda activate myenv
Install torch from wheel
pip install torch==1.7.0+cu110 torchvision==0.8.1+cu110 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
Please note I had to install torchvision==0.8.1+cu110 as reported here
I'm new to pytorch geometric, tried to install it to my computer but failed, so I'm trying to run the code on Google Colab instead. According to this previous question (which didn't help me and I'mnot sure its the same issue):
PyTorch Geometric CUDA installation issues on Google Colab
I did:
!pip install --upgrade torch-scatter
!pip install --upgrade torch-sparse
!pip install --upgrade torch-cluster
!pip install --upgrade torch-spline-conv
!pip install torch-geometric
!pip install torch-cluster==latest+cu101 -f https://s3.eu-central-1.amazonaws.com/pytorch-geometric.com/whl/torch-1.4.0.html
!pip install torch-scatter==latest+cu101 torch-sparse==latest+cu101 torch-spline-conv==latest+cu101 -f https://s3.eu-central-1.amazonaws.com/pytorch-geometric.com/whl/torch-1.4.0.html
they print:
Successfully installed torch-cluster-1.5.4
Successfully installed torch-scatter-2.0.4 torch-sparse-0.6.1 torch-spline-conv-1.2.0
However, when I try to run
import torch_geometric.datasets as datasets
I get:
RuntimeError: Detected that PyTorch and torch_sparse were compiled with different CUDA versions. PyTorch has CUDA version 10.1 and torch_sparse has CUDA version 0.0. Please reinstall the torch_sparse that matches your PyTorch install.
Any help would be greatly appretiated.
I came up with the following snippet that should work on Colab to install PyTorch Geometric and its dependencies:
https://gist.github.com/ameya98/b193856171d11d37ada46458f60e73e7
# Add this in a Google Colab cell to install the correct version of Pytorch Geometric.
import torch
def format_pytorch_version(version):
return version.split('+')[0]
TORCH_version = torch.__version__
TORCH = format_pytorch_version(TORCH_version)
def format_cuda_version(version):
return 'cu' + version.replace('.', '')
CUDA_version = torch.version.cuda
CUDA = format_cuda_version(CUDA_version)
!pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-geometric
I have updated the answer from that previous question. Hope this works now. Also don't forget to select GPU Runtime.
!pip install torch-geometric \
torch-sparse==latest+cu101 \
torch-scatter==latest+cu101 \
torch-cluster==latest+cu101 \
-f https://pytorch-geometric.com/whl/torch-1.4.0.html
I am getting this error while using 'conda install tensorflow' to install tensorflow on Anaconda
CondaVerificationError: The package for tensorflow-base located at
'Lib/site-packages/tensorflow-2.1.0.data/purelib/tensorflow_core/include/tensorflow_core/core/grappler/optimizers/generic_layout_optimizer_transposer_factory.h'specified
in the package manifest cannot be found.
Any Help will be appreciated, Thanks.
Uninstall the tensorflow and install it again :
Try this:
pip install tensorflow #CPU only
pip install tensorflow-gpu #For GPU support
or
conda install -c conda-forge tensorflow
After having upgraded my environment's python to Python 3.61, I attempted to install pytorch using this command:
conda install -c peterjc123 pytorch
However I got this error:
Fetching package metadata .............
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
-pytorch
-pyqt
I also used the commands
conda install -c peterjc123 pytorch cuda90
conda install -c peterjc123 pytorch cuda80
But the result is still the same. Anyone got a clue how to solve this?
The problem was solved after downgrading from Python 3.6.2 to Python 3.5.1 after running:
conda install -c anaconda python=3.5.1
After running this command, run:
conda install -c peterjc123 pytorch
Pytorch should install as per normal. A similar issue occurs for openCV as well
An alternative way to install pytorch using anaconda is
conda create -n py_env python=3.5
source activate py_env
conda install pytorch-cpu torchvision -c pytorch
Go to python shell and import using the command
import torch
Hope this helps.