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

username: T_fighting
cooked: <p>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<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/d/d7f3cb481a7eed0e7e4ba85aab6bc0390dea6128.png" data-download-href="https://discuss.pytorch.org/uploads/default/d7f3cb481a7eed0e7e4ba85aab6bc0390dea6128" title="Screenshot%20from%202019-09-02%2008-43-09"><img src="https://discuss.pytorch.org/uploads/default/original/2X/d/d7f3cb481a7eed0e7e4ba85aab6bc0390dea6128.png" alt="Screenshot%20from%202019-09-02%2008-43-09" data-base62-sha1="uOoYUQuDVaY0koJaon5QDB7MvaM" width="690" height="429" data-dominant-color="402036"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot%20from%202019-09-02%2008-43-09</span><span class="informations">803×500 91.4 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>The intresting thing is that everything is ok when I use tensorflow.<br>
The detail below is about TF2.0<br>
‘’’<br>
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<br>
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<br>
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<br>
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<br>
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<br>
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<br>
2019-09-02 08:39:51.861754: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7<br>
‘’’</p>
<p>I hope who can help me to fix it.Thanks.</p>
<p>ps:<br>
OS:ubuntu18.04<br>
cuda:10.0<br>
torch 1.2.0<br>
torchvision 0.3</p>

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

username: T_fighting
cooked: <aside class="quote no-group" data-username="ptrblck" data-post="2" data-topic="54905">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/48/1823_2.png" class="avatar"> ptrblck:</div>
<blockquote>
<p>you insta</p>
</blockquote>
</aside>
<p>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.</p>

username: ptrblck
cooked: <p>Good to hear it’s working with the older version. Did you install <code>torchvision</code> 0.3 using the conda or pip binaries? If so, could you try to install the latest version using the same approach?</p>

username: T_fighting
cooked: <p>Ok! I will try it! Enjoy pytorch!</p>