CuPyがターミナルでは使えるのにPyCharmでは使えない
現在以下の環境で行っています
$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS" $ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2017 NVIDIA Corporation Built on Fri_Sep__1_21:08:03_CDT_2017 Cuda compilation tools, release 9.0, V9.0.176 seino@seino-FRONTIER:~$ ^C pycharm --> 2018.3 cupy --> cupy-cuda90 # .bashrcに直接以下を打っている export PATH="/usr/local/cuda-9.0/bin:$PATH" export LD_LIBRARY_PATH="/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH"
ターミナルではCuPyを実行できます。
$ python Python 3.6.6 |Anaconda, Inc.| (default, Oct 9 2018, 12:34:16) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import cupy >>> cupy.arange(9) array([0, 1, 2, 3, 4, 5, 6, 7, 8])
PyCharmで同じコードを実行すると次のエラーが出ます。
Traceback (most recent call last): File "/home/seino/anaconda3/lib/python3.6/site-packages/cupy/__init__.py", line 11, in <module> from cupy import core # NOQA File "/home/seino/anaconda3/lib/python3.6/site-packages/cupy/core/__init__.py", line 1, in <module> from cupy.core import core # NOQA ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/seino/PycharmProjects/MNIST/dataset.py", line 1, in <module> import cupy File "/home/seino/anaconda3/lib/python3.6/site-packages/cupy/__init__.py", line 32, in <module> six.reraise(ImportError, ImportError(msg), exc_info[2]) File "/home/seino/anaconda3/lib/python3.6/site-packages/six.py", line 692, in reraise raise value.with_traceback(tb) File "/home/seino/anaconda3/lib/python3.6/site-packages/cupy/__init__.py", line 11, in <module> from cupy import core # NOQA File "/home/seino/anaconda3/lib/python3.6/site-packages/cupy/core/__init__.py", line 1, in <module> from cupy.core import core # NOQA ImportError: CuPy is not correctly installed. If you are using wheel distribution (cupy-cudaXX), make sure that the version of CuPy you installed matches with the version of CUDA on your host. Also, confirm that only one CuPy package is installed: $ pip freeze If you are building CuPy from source, please check your environment, uninstall CuPy and reinstall it with: $ pip install cupy --no-cache-dir -vvvv Check the Installation Guide for details: https://docs-cupy.chainer.org/en/latest/install.html original error: libcublas.so.9.0: cannot open shared object file: No such file or directory
確認したこと
・CuPyが他にも入っているのでは? --> なかった
・libcublas.so.9.0がないのでは? --> あった(/usr/local/cuda-9.0/lib64)
・cupy-cuda90ではなくcupyをインストールしたらいいのでは? --> はいらなかった(#error -- unsupported GNU version! gcc versions later than 6 are not supported!)
自分では解決できそうにありません。お力添えよろしくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。