ImportError: /home/name/anaconda3/envs/tf21/lib/python3.7/site-packages/torch/lib/../../../../libnvToolsExt.so.1: invalid ELF header

username: yaxika
cooked: <h2>ubuntu conda install pytorch success,but when I code “import torch” and run, then occurs:</h2>
<p>ImportError                               Traceback (most recent call last)<br>
 in <br>
1 from <strong>future</strong> import print_function<br>
----&gt; 2 import torch<br>
3 x = torch.rand(5, 3)<br>
4 print(x)</p>
<p>~/anaconda3/envs/tf21/lib/python3.7/site-packages/torch/<strong>init</strong>.py in <br>
79 del _dl_flags<br>
80<br>
—&gt; 81 from torch._C import *<br>
82<br>
83 <strong>all</strong> += [name for name in dir(_C)</p>
<p>ImportError: /home/name/anaconda3/envs/tf21/lib/python3.7/site-packages/torch/lib/…/…/…/…/libnvToolsExt.so.1: invalid ELF header</p>
<p>And my conda list is as follow:</p>
<h1>Name                    Version                   Build  Channel</h1>
<p>_libgcc_mutex             0.1                 conda_forge    conda-forge<br>
_openmp_mutex             4.5                      1_llvm    conda-forge<br>
_py-xgboost-mutex         2.0                       cpu_0    conda-forge<br>
_tflow_select             2.1.0                       gpu<br>
absl-py                   0.9.0            py37hc8dfbb8_1    conda-forge<br>
alabaster                 0.7.12                     py_0    conda-forge<br>
argh                      0.26.2                py37_1001    conda-forge<br>
astroid                   2.4.2            py37hc8dfbb8_0    conda-forge<br>
astunparse                1.6.3                      py_0<br>
atomicwrites              1.4.0              pyh9f0ad1d_0    conda-forge<br>
attrs                     19.3.0                     py_0    conda-forge<br>
autopep8                  1.5.2              pyh9f0ad1d_0    conda-forge<br>
babel                     2.8.0                      py_0    conda-forge<br>
backcall                  0.1.0                      py_0    conda-forge<br>
bleach                    3.1.5              pyh9f0ad1d_0    conda-forge<br>
blinker                   1.4                        py_1    conda-forge<br>
brotlipy                  0.7.0           py37h8f50634_1000    conda-forge<br>
c-ares                    1.15.0            h516909a_1001    conda-forge<br>
ca-certificates           2020.6.24                     0<br>
cachetools                4.1.0                      py_1    conda-forge<br>
certifi                   2020.6.20                py37_0<br>
cffi                      1.14.0           py37hd463f26_0    conda-forge<br>
chardet                   3.0.4           py37hc8dfbb8_1006    conda-forge<br>
click                     7.1.2              pyh9f0ad1d_0    conda-forge<br>
cloudpickle               1.4.1                      py_0    conda-forge<br>
colorama                  0.4.3                      py_0    conda-forge<br>
cryptography              2.9.2            py37hb09aad4_0    conda-forge<br>
cudatoolkit               10.1.243             h6bb024c_0<br>
cudnn                     7.6.5                cuda10.1_0<br>
cupti                     10.1.168                      0<br>
cycler                    0.10.0                     py_2    conda-forge<br>
dbus                      1.13.6               he372182_0    conda-forge<br>
decorator                 4.4.2                      py_0    conda-forge<br>
defusedxml                0.6.0                      py_0    conda-forge<br>
diff-match-patch          20181111                   py_0    conda-forge<br>
docutils                  0.16             py37hc8dfbb8_1    conda-forge<br>
entrypoints               0.3             py37hc8dfbb8_1001    conda-forge<br>
expat                     2.2.9                he1b5a44_2    conda-forge<br>
flake8                    3.7.9            py37hc8dfbb8_1    conda-forge<br>
fontconfig                2.13.1            h86ecdb6_1001    conda-forge<br>
freetype                  2.10.2               he06d7ca_0    conda-forge<br>
future                    0.18.2           py37hc8dfbb8_1    conda-forge<br>
gast                      0.3.3                      py_0    conda-forge<br>
gettext                   0.19.8.1          hc5be6a0_1002    conda-forge<br>
glib                      2.64.3               h6f030ca_0    conda-forge<br>
google-auth               1.16.1             pyh9f0ad1d_0    conda-forge<br>
google-auth-oauthlib      0.4.1                      py_2    conda-forge<br>
google-pasta              0.2.0              pyh8c360ce_0    conda-forge<br>
grpcio                    1.27.2           py37hf8bcb03_0<br>
gst-plugins-base          1.14.5               h0935bb2_2    conda-forge<br>
gstreamer                 1.14.5               h36ae1b5_2    conda-forge<br>
h5py                      2.10.0          nompi_py37h513d04c_102    conda-forge<br>
hdf5                      1.10.5          nompi_h3c11f04_1104    conda-forge<br>
icu                       64.2                 he1b5a44_1    conda-forge<br>
idna                      2.9                        py_1    conda-forge<br>
imagesize                 1.2.0                      py_0    conda-forge<br>
importlib-metadata        1.6.1            py37hc8dfbb8_0    conda-forge<br>
importlib_metadata        1.6.1                         0    conda-forge<br>
intel-openmp              2020.1                      217<br>
intervaltree              3.0.2                      py_0    conda-forge<br>
ipykernel                 5.3.2            py37h5ca1d4c_0<br>
ipython                   7.15.0           py37hc8dfbb8_0    conda-forge<br>
ipython_genutils          0.2.0                      py_1    conda-forge<br>
ipywidgets                7.5.1                      py_0    conda-forge<br>
isort                     4.3.21           py37hc8dfbb8_1    conda-forge<br>
jedi                      0.15.2                   py37_0    conda-forge<br>
jeepney                   0.4.3                      py_0    conda-forge<br>
jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge<br>
joblib                    0.15.1                     py_0    conda-forge<br>
jpeg                      9d                   h516909a_0    conda-forge<br>
jsonschema                3.2.0            py37hc8dfbb8_1    conda-forge<br>
jupyter                   1.0.0                    py37_7<br>
jupyter_client            6.1.3                      py_0    conda-forge<br>
jupyter_console           6.1.0                      py_1    conda-forge<br>
jupyter_contrib_core      0.3.3                      py_2    conda-forge<br>
jupyter_contrib_nbextensions 0.5.1                    py37_0    conda-forge<br>
jupyter_core              4.6.3            py37hc8dfbb8_1    conda-forge<br>
jupyter_highlight_selected_word 0.2.0                 py37_1000    conda-forge<br>
jupyter_latex_envs        1.4.6                 py37_1000    conda-forge<br>
jupyter_nbextensions_configurator 0.4.1            py37hc8dfbb8_1    conda-forge<br>
keras-preprocessing       1.1.0                      py_0    conda-forge<br>
keras-tuner               1.0.1                      py_0    conda-forge<br>
keyring                   21.2.1           py37hc8dfbb8_0    conda-forge<br>
kiwisolver                1.2.0            py37h99015e2_0    conda-forge<br>
lazy-object-proxy         1.4.3            py37h8f50634_2    conda-forge<br>
lcms2                     2.11                 h396b838_0<br>
libblas                   3.8.0               16_openblas    conda-forge<br>
libcblas                  3.8.0               16_openblas    conda-forge<br>
libclang                  9.0.1           default_hde54327_0    conda-forge<br>
libedit                   3.1.20191231         h46ee950_0    conda-forge<br>
libffi                    3.2.1             he1b5a44_1007    conda-forge<br>
libgcc-ng                 9.2.0                h24d8f2e_2    conda-forge<br>
libgfortran-ng            7.5.0                hdf63c60_6    conda-forge<br>
libiconv                  1.15              h516909a_1006    conda-forge<br>
liblapack                 3.8.0               16_openblas    conda-forge<br>
libllvm8                  8.0.1                hc9558a2_0    conda-forge<br>
libllvm9                  9.0.1                he513fc3_1    conda-forge<br>
libopenblas               0.3.9                h5ec1e0e_0    conda-forge<br>
libpng                    1.6.37               hed695b0_1    conda-forge<br>
libprotobuf               3.12.3               h8b12597_0    conda-forge<br>
libsodium                 1.0.17               h516909a_0    conda-forge<br>
libspatialindex           1.9.3                he1b5a44_3    conda-forge<br>
libstdcxx-ng              9.2.0                hdf63c60_2    conda-forge<br>
libtiff                   4.1.0                h2733197_1<br>
libuuid                   2.32.1            h14c3975_1000    conda-forge<br>
libxcb                    1.13              h14c3975_1002    conda-forge<br>
libxgboost                1.0.2                he1b5a44_1    conda-forge<br>
libxkbcommon              0.10.0               he1b5a44_0    conda-forge<br>
libxml2                   2.9.10               hee79883_0    conda-forge<br>
libxslt                   1.1.33               h31b3aaa_0    conda-forge<br>
llvm-openmp               10.0.0               hc9558a2_0    conda-forge<br>
llvmlite                  0.32.1           py37h5202443_0    conda-forge<br>
lxml                      4.5.1            py37hefd8a0e_0<br>
lz4-c                     1.9.2                he6710b0_1<br>
markdown                  3.2.2                      py_0    conda-forge<br>
markupsafe                1.1.1            py37h8f50634_1    conda-forge<br>
matplotlib                3.2.1                         0    conda-forge<br>
matplotlib-base           3.2.1            py37h30547a4_0    conda-forge<br>
mccabe                    0.6.1                      py_1    conda-forge<br>
mistune                   0.8.4           py37h8f50634_1001    conda-forge<br>
mkl                       2020.1                      217<br>
nbconvert                 5.6.1            py37hc8dfbb8_1    conda-forge<br>
nbformat                  5.0.6                      py_0    conda-forge<br>
ncurses                   6.1               hf484d3e_1002    conda-forge<br>
ninja                     1.10.0           py37hfd86e86_0<br>
notebook                  6.0.3            py37hc8dfbb8_0    conda-forge<br>
nspr                      4.25                 he1b5a44_0    conda-forge<br>
nss                       3.47                 he751ad9_0    conda-forge<br>
numba                     0.49.1           py37h0da4684_0    conda-forge<br>
numpy                     1.17.5           py37h95a1406_0    conda-forge<br>
numpydoc                  1.0.0              pyh9f0ad1d_0    conda-forge<br>
oauthlib                  3.0.1                      py_0    conda-forge<br>
olefile                   0.46                     py37_0<br>
openssl                   1.1.1g               h7b6447c_0<br>
opt_einsum                3.2.1                      py_0    conda-forge<br>
ordered-set               4.0.2                    pypi_0    pypi<br>
packaging                 20.4               pyh9f0ad1d_0    conda-forge<br>
pandas                    1.0.4            py37h0da4684_0    conda-forge<br>
pandoc                    2.9.2.1                       0    conda-forge<br>
pandocfilters             1.4.2                      py_1    conda-forge<br>
parso                     0.5.2                      py_0    conda-forge<br>
pathtools                 0.1.2                      py_1    conda-forge<br>
patsy                     0.5.1                      py_0    conda-forge<br>
pcre                      8.44                 he1b5a44_0    conda-forge<br>
pexpect                   4.8.0            py37hc8dfbb8_1    conda-forge<br>
pickleshare               0.7.5           py37hc8dfbb8_1001    conda-forge<br>
pillow                    7.2.0            py37hb39fc2d_0<br>
pip                       20.1.1                   py37_1<br>
pluggy                    0.13.1           py37hc8dfbb8_1    conda-forge<br>
prometheus_client         0.8.0              pyh9f0ad1d_0    conda-forge<br>
prompt-toolkit            3.0.5                      py_0    conda-forge<br>
prompt_toolkit            3.0.5                         0    conda-forge<br>
protobuf                  3.12.3           py37h3340039_0    conda-forge<br>
psutil                    5.7.0            py37h8f50634_1    conda-forge<br>
pthread-stubs             0.4               h14c3975_1001    conda-forge<br>
ptyprocess                0.6.0                   py_1001    conda-forge<br>
py-xgboost                1.0.2            py37hc8dfbb8_1    conda-forge<br>
pyasn1                    0.4.8                      py_0    conda-forge<br>
pyasn1-modules            0.2.7                      py_0    conda-forge<br>
pycodestyle               2.5.0                      py_0    conda-forge<br>
pycparser                 2.20                       py_0    conda-forge<br>
pydocstyle                5.0.2                      py_0    conda-forge<br>
pyflakes                  2.1.1                      py_0    conda-forge<br>
pygments                  2.6.1                      py_0    conda-forge<br>
pyjwt                     1.7.1                      py_0    conda-forge<br>
pylint                    2.5.2            py37hc8dfbb8_0    conda-forge<br>
pyopenssl                 19.1.0                     py_1    conda-forge<br>
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge<br>
pyqt                      5.12.3           py37h8685d9f_3    conda-forge<br>
pyqt5-sip                 4.19.18                  pypi_0    pypi<br>
pyqtchart                 5.12                     pypi_0    pypi<br>
pyqtwebengine             5.12.1                   pypi_0    pypi<br>
pyrsistent                0.16.0           py37h8f50634_0    conda-forge<br>
pysocks                   1.7.1            py37hc8dfbb8_1    conda-forge<br>
python                    3.7.4                h265db76_1<br>
python-dateutil           2.8.1                      py_0    conda-forge<br>
python-graphviz           0.14.1                   pypi_0    pypi<br>
python-jsonrpc-server     0.3.4              pyh9f0ad1d_1    conda-forge<br>
python-language-server    0.31.10          py37hc8dfbb8_0    conda-forge<br>
python_abi                3.7                     1_cp37m    conda-forge<br>
pytorch                   1.4.0           py3.7_cuda10.1.243_cudnn7.6.3_0    pytorch<br>
pytz                      2020.1             pyh9f0ad1d_0    conda-forge<br>
pyxdg                     0.26                       py_0    conda-forge<br>
pyyaml                    5.3.1            py37h8f50634_0    conda-forge<br>
pyzmq                     19.0.1           py37hac76be4_0    conda-forge<br>
qdarkstyle                2.8.1              pyh9f0ad1d_0    conda-forge<br>
qt                        5.12.5               hd8c4c69_1    conda-forge<br>
qtawesome                 0.7.2              pyh9f0ad1d_0    conda-forge<br>
qtconsole                 4.7.4              pyh9f0ad1d_0    conda-forge<br>
qtpy                      1.9.0                      py_0    conda-forge<br>
readline                  7.0               hf8c457e_1001    conda-forge<br>
requests                  2.23.0             pyh8c360ce_2    conda-forge<br>
requests-oauthlib         1.2.0                      py_0    conda-forge<br>
rope                      0.17.0             pyh9f0ad1d_0    conda-forge<br>
rsa                       4.0                        py_0    conda-forge<br>
rtree                     0.9.4            py37h8526d28_1    conda-forge<br>
scikit-learn              0.23.1           py37h8a51577_0    conda-forge<br>
scikit-plot               0.3.7                      py_1    conda-forge<br>
scipy                     1.4.1            py37ha3d9a3c_3    conda-forge<br>
seaborn                   0.10.1                        1    conda-forge<br>
seaborn-base              0.10.1                     py_1    conda-forge<br>
secretstorage             3.1.2            py37hc8dfbb8_1    conda-forge<br>
send2trash                1.5.0                      py_0    conda-forge<br>
setuptools                47.1.1           py37hc8dfbb8_0    conda-forge<br>
six                       1.15.0             pyh9f0ad1d_0    conda-forge<br>
snowballstemmer           2.0.0                      py_0    conda-forge<br>
sortedcontainers          2.2.1              pyh9f0ad1d_0    conda-forge<br>
sphinx                    3.1.0                      py_0    conda-forge<br>
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge<br>
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge<br>
sphinxcontrib-htmlhelp    1.0.3                      py_0    conda-forge<br>
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge<br>
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge<br>
sphinxcontrib-serializinghtml 1.1.4                      py_0    conda-forge<br>
spyder                    4.1.3            py37hc8dfbb8_0    conda-forge<br>
spyder-kernels            1.9.1            py37hc8dfbb8_0    conda-forge<br>
sqlite                    3.31.1               h7b6447c_0<br>
statsmodels               0.11.1           py37h8f50634_2    conda-forge<br>
tabulate                  0.8.7              pyh9f0ad1d_0    conda-forge<br>
tensorboard               2.2.1              pyh532a8cf_0<br>
tensorboard-plugin-wit    1.6.0                      py_0<br>
tensorflow                2.2.0           gpu_py37h1a511ff_0<br>
tensorflow-base           2.2.0           gpu_py37h8a81be8_0<br>
tensorflow-estimator      2.2.0              pyh208ff02_0<br>
tensorflow-gpu            2.2.0                h0d30ee6_0<br>
termcolor                 1.1.0                      py_2    conda-forge<br>
terminado                 0.8.3            py37hc8dfbb8_1    conda-forge<br>
terminaltables            3.1.0                      py_0    conda-forge<br>
testpath                  0.4.4                      py_0    conda-forge<br>
threadpoolctl             2.1.0              pyh5ca1d4c_0    conda-forge<br>
tk                        8.6.10               hed695b0_0    conda-forge<br>
toml                      0.10.1             pyh9f0ad1d_0    conda-forge<br>
torchmeta                 1.4.6                    pypi_0    pypi<br>
torchvision               0.5.0                py37_cu101    pytorch<br>
tornado                   6.0.4            py37h8f50634_1    conda-forge<br>
tqdm                      4.46.1             pyh9f0ad1d_0    conda-forge<br>
traitlets                 4.3.3            py37hc8dfbb8_1    conda-forge<br>
typed-ast                 1.4.1            py37h516909a_0    conda-forge<br>
ujson                     1.35            py37h3340039_1002    conda-forge<br>
urllib3                   1.25.9                     py_0    conda-forge<br>
watchdog                  0.10.2                   py37_0    conda-forge<br>
wcwidth                   0.2.4              pyh9f0ad1d_0    conda-forge<br>
webencodings              0.5.1                      py_1    conda-forge<br>
werkzeug                  1.0.1              pyh9f0ad1d_0    conda-forge<br>
wheel                     0.34.2                     py_1    conda-forge<br>
widgetsnbextension        3.5.1                    py37_0    conda-forge<br>
wrapt                     1.11.2           py37h8f50634_0    conda-forge<br>
wurlitzer                 2.0.0            py37hc8dfbb8_1    conda-forge<br>
xorg-libxau               1.0.9                h14c3975_0    conda-forge<br>
xorg-libxdmcp             1.1.3                h516909a_0    conda-forge<br>
xz                        5.2.5                h516909a_0    conda-forge<br>
yaml                      0.2.5                h516909a_0    conda-forge<br>
yapf                      0.29.0                     py_0    conda-forge<br>
zeromq                    4.3.2                he1b5a44_2    conda-forge<br>
zipp                      3.1.0                      py_0    conda-forge<br>
zlib                      1.2.11            h516909a_1006    conda-forge<br>
zstd                      1.4.5                h9ceee32_0</p>

username: Kushaj
cooked: <p>Change directory or Install again.</p>

username: yaxika
cooked: <p>Thank you very much!<br>
I had changed the environment, the problem is the same. But I use pip install as the pytorch website shows us the problem is solved.</p>

username: yaxika
cooked: <p>Use this method, it is OK<br>
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f <a href="https://download.pytorch.org/whl/torch_stable.html" rel="nofollow noopener">https://download.pytorch.org/whl/torch_stable.html</a></p>

username: Kushaj
cooked: <p>It is the official method, so it must work.</p>