From torch._C import*

My previous installations of CUDA8.0, anaconda, python3.6, and pytorch 1.0 on ubuntu 16.04 worked fine.
I upgraded CUDA8.0 to CUDA10.0 and pytorch 1.0 to pytorch1.1 on ubuntu 16.04 server, and the following errors occurred:
file “/anaconda3/**/python3.6/site-packages/torch/",line 79, in from torch._C import* open shared object file:No such file or directory.

How to solve this problem? Thank you.

Did you build PyTorch from source?
If so, could you try to clean the build (python clean) and uninstall all old versions?

pip uninstall torch
pip uninstall torch
conda uninstall pytorch

(also *-nighly builds if previously installed).

However, if you didn’t build it from source, you don’t need to install CUDA on your system, as the PyTorch binaries will already ship with the CUDA and cudnn runtime libs.

First of all, thank you very much for your answer! I’m pretty sure I’ve installed torch under anaconda, but when I import torch in python, the current python environment doesn’t know all the search paths for dependent dynamic libraries under the torch library.

Could you create a new and clean conda environment and install pytorch there again?

conda create -n pytorch_env Python=3.7 Anaconda
conda activate pytorch_env
conda install pytorch torchvision cudatoolkit=10.0 -c pytorch