How to fix the error "ImportError: libcudart.so.9.0:"?

The error always troubles me.I have refered to the official website for installing torch and torchvision by the package called pip .When I import torch,everything goes well;but when I import torchvision,the error always occurs。the screenshot shows below

The intresting thing is that everything is ok when I use tensorflow.
The detail below is about TF2.0
‘’’
2019-09-02 08:39:51.517620: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudart.so.10.0
2019-09-02 08:39:51.608876: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcublas.so.10.0
2019-09-02 08:39:51.636179: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcufft.so.10.0
2019-09-02 08:39:51.644710: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcurand.so.10.0
2019-09-02 08:39:51.705207: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcusolver.so.10.0
2019-09-02 08:39:51.742977: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcusparse.so.10.0
2019-09-02 08:39:51.861754: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7
‘’’

I hope who can help me to fix it.Thanks.

ps:
OS:ubuntu18.04
cuda:10.0
torch 1.2.0
torchvision 0.3

Which binaries did you install (with which CUDA versions) or did you build from source?
Could you make sure to uninstall all older torchvision and PyTorch versions and reinstall them afterwards?
It might also be a good idea to create a new virtual environment.

Thanks for your answer! I have fixed it by uninstalling the current version(torchvision 0.4) and reinstalling the older torchvision(0.3). Now,everything goes well.

Good to hear it’s working with the older version. Did you install torchvision 0.3 using the conda or pip binaries? If so, could you try to install the latest version using the same approach?

Ok! I will try it! Enjoy pytorch!