I have installed the correct version of CuPy with pip install cupy-cuda117 on pyCharms as my CUDA is version 11.7. My Python version is 3.8. I also have the environment variables set but I am still receiving this message:
Traceback (most recent call last):
File "C:\Users\Dominic\PycharmProjects\Project_Trading\venv\lib\site-packages\cupy\__init__.py", line 18, in <module>
from cupy import _core # NOQA
File "C:\Users\Dominic\PycharmProjects\Project_Trading\venv\lib\site-packages\cupy\_core\__init__.py", line 1, in <module>
from cupy._core import core # NOQA
File "cupy\_core\core.pyx", line 1, in init cupy._core.core
File "C:\Users\Dominic\PycharmProjects\Project_Trading\venv\lib\site-packages\cupy\cuda\__init__.py", line 8, in <module>
from cupy.cuda import compiler # NOQA
File "C:\Users\Dominic\PycharmProjects\Project_Trading\venv\lib\site-packages\cupy\cuda\compiler.py", line 13, in <module>
from cupy.cuda import device
File "cupy\cuda\device.pyx", line 1, in init cupy.cuda.device
ImportError: DLL load failed while importing runtime: The specified module could not be found.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:/Users/Dominic/PycharmProjects/Project_Trading/regression_to_classification.py", line 77, in <module>
import cupy
File "C:\Users\Dominic\PycharmProjects\Project_Trading\venv\lib\site-packages\cupy\__init__.py", line 20, in <module>
raise ImportError(f'''
ImportError:
================================================================
Failed to import CuPy.
If you installed CuPy via wheels (cupy-cudaXXX or cupy-rocm-X-X), make sure that the package matches with the version of CUDA or ROCm installed.
On Linux, you may need to set LD_LIBRARY_PATH environment variable depending on how you installed CUDA/ROCm.
On Windows, try setting CUDA_PATH environment variable.
Check the Installation Guide for details:
https://docs.cupy.dev/en/latest/install.html
Original error:
ImportError: DLL load failed while importing runtime: The specified module could not be found.
================================================================
Process finished with exit code 1
Here is some additional info:
I ran into something similar when trying to install cupy recently. These are the steps that ultimately resulted in the import error:
Try to pip install cupy.
Realize that this is taking too long and/or requires a compiler etc.
Stop the install/build.
Install one of the prebuilt wheels (e.g. pip install cupy-cuda11x).
Notice that the cupy package is somehow installed (probably a remnant from the first stage).
pip uninstall cupy to get rid of the cupy library which shouldn't be there. << This is the stage that causes the problem!
The last step above breaks whichever mappings the wheel installer creates that allow one to import cupy despite installing a package called e.g. cupy-cuda11x.
The solution that worked for me was to remove all cupy* packages and install only the wheel distribution. In the case shown in the question, reinstalling cupy-cuda11x should do the trick.
Related
I am using anaconda with sublime text 4 on Win11. Every thing works in the anaconda prompt, but in ST4, importing modules such as Numpy, Scipy will raise:
D:\Anaconda3\lib\site-packages\numpy\__init__.py:148: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
from . import _distributor_init
Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 22, in <module>
from . import multiarray
File "D:\Anaconda3\lib\site-packages\numpy\core\multiarray.py", line 12, in <module>
from . import overrides
File "D:\Anaconda3\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed while importing _multiarray_umath...
Modules such as 'os' can be properly imported.
The path of anaconda has already been written in the settings of ST4 plugin Conda and Anaconda, as well as %PATH%.
This problem also happens on ST3 with Win10.
I'm running into issues with importing CuPy after pip installing cupy-cuda101. I've ensured that I'm using the correct CUDA version available and that I only have one version of CuPy installed.
The error code are like follows:
import cupy
Traceback (most recent call last):
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/__init__.py", line 16, in <module>
from cupy import _core # NOQA
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/_core/__init__.py", line 1, in <module>
from cupy._core import core # NOQA
File "cupy/_core/core.pyx", line 1, in init cupy._core.core
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/cuda/__init__.py", line 8, in <module>
from cupy.cuda import compiler # NOQA
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/cuda/compiler.py", line 11, in <module>
from cupy.cuda import device
File "cupy/cuda/device.pyx", line 10, in init cupy.cuda.device
ImportError: /home1/xuchenhao/.local/lib/python3.7/site-packages/cupy_backends/cuda/libs/cusparse.cpython-37m-x86_64-linux-gnu.so: symbol cusparseConstrainedGeMM_bufferSize version libcusparse.so.10 not defined in file libcusparse.so.10 with link time reference
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/__init__.py", line 37, in <module>
raise ImportError(_msg) from e
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.dev/en/latest/install.html
original error: /home1/xuchenhao/.local/lib/python3.7/site-packages/cupy_backends/cuda/libs/cusparse.cpython-37m-x86_64-linux-gnu.so: symbol cusparseConstrainedGeMM_bufferSize version libcusparse.so.10 not defined in file libcusparse.so.10 with link time reference
My environments are:
python=3.7.6
GCC=7.3.0
cuda=10.1.168
cupy-cuda101=9.5.0
How can I fix this problem?
I've gotten my hands on a AIY voice kit v1 and am stuck with the assistant_grpc_demo.py with it failing at an import statement with the grpc. I should have everything installed already, yet google.auth.transport can't seem to find it. I am using a pi 3 A+. Below is the terminal commands I used and their outputs.
pi#raspberrypi:~ $ cat testinput.py
import google.auth.transport.grpc
pi#raspberrypi:~ $ python3 testinput.py
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/google/auth/transport/grpc.py", line 30, in <module>
import grpc
File "/home/pi/.local/lib/python3.7/site-packages/grpc/__init__.py", line 22, in <module>
from grpc import _compression
File "/home/pi/.local/lib/python3.7/site-packages/grpc/_compression.py", line 15, in <module>
from grpc._cython import cygrpc
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found (required by /home/pi/.local/lib/python3.7/site-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "testinput.py", line 1, in <module>
import google.auth.transport.grpc
File "/home/pi/.local/lib/python3.7/site-packages/google/auth/transport/grpc.py", line 37, in <module>
caught_exc,
File "<string>", line 3, in raise_from
ImportError: gRPC is not installed, please install the grpcio package to use the gRPC transport.
*Maybe the glibc part is the problem. Not sure how to resolve that as I already have libc6 2.28. Is there a way to get the aiy-python-wheels to work with my set-up or a previous version. Already tried flashing a pre-built official image built on 4-13-2018 with everything set up, though it failed to boot. Trying to download all packages manually. assistant_library_with_button.sh works though.
Not sure how to resolve that as I already have libc6 2.28
The error message says: .../site-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so requires GLIBC_2.33.
Your libc6 is too old for that gRPC package to work -- it was compiled on a newer system.
You must either:
get a different gRPC package -- one compiled on and suitable for running on a GLIBC-2.28 (or earlier) based system, or
get a different GLIBC package (2.33 or later).
I have a project which I am packaging with cx_freeze. When I try to run the resulting exe I get an ImportError: DLL load failed: The specified module could not be found.
Here is my setup.py:
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(build_exe='liquidation', packages=['scipy', 'numpy'], excludes=['scipy.spatial.cKDTree'],
includes=['scipy', 'numpy', 'numpy.core._methods', 'scipy.sparse.csgraph._validation',
'numpy.lib.format', 'numpy.linalg._umath_linalg', 'scipy.sparse._csparsetools',
'scipy.sparse.linalg.isolve._iterative', 'scipy.sparse.linalg.eigen.arpack._arpack',
'scipy.special._ufuncs_cxx', 'scipy.special.specfun', 'scipy.integrate._odepack',
'scipy.integrate._quadpack', 'scipy.integrate.vode', 'scipy.integrate._dop',
'scipy.integrate.lsoda', 'scipy.optimize._minpack', 'scipy.optimize._zeros',
'scipy.spatial', 'scipy.spatial.ckdtree', 'scipy.spatial.kdtree',
'scipy._distributor_init', 'numpy.core._multiarray_umath'])
base = 'Console'
executables = [
Executable('liquidation.py', base=base, targetName='liquidation.exe')
]
setup(name='liquidation',
version='2.0',
description='Program to run and test Liquidation algorithms',
options=dict(build_exe=buildOptions),
executables=executables)
When I run python setup.py build_exe it seems to complete successfully, but when I run the exe I get the following output:
Traceback (most recent call last):
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\numpy\core\__init__.py", line 24, in <module>
from . import multiarray
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\numpy\core\multiarray.py", line 14, in <module>
from . import overrides
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 40, in run
module.run()
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\cx_Freeze\initscripts\Console.py", line 37, in run
exec(code, {'__name__': '__main__'})
File "liquidation.py", line 64, in <module>
from io_tools.stock_wrapper import StockWrapper
File "C:\Users\tamar\PycharmProjects\liquidation\io_tools\stock_wrapper.py", line 4, in <module>
from io_tools.io_helper import *
File "C:\Users\tamar\PycharmProjects\liquidation\io_tools\io_helper.py", line 7, in <module>
from numpy import float_
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\numpy\core\__init__.py", line 54, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
1. Check that you expected to use Python3.7 from "C:\Users\tamar\PycharmProjects\liquidation\liquidation\liquidation.exe",
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy version "1.18.3" you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: DLL load failed: The specified module could not be found.
I understand that I need to point cx_freeze to the missing DLL's (either by adding them to buildOptions.include_files or by actually copying the DLL's to the build folder) but I am at a loss as to how to know which DLL's I am missing. numpy.core._multiarray_umath is in the build folder so I don't know what it could be.
I believe I am using the latest versions of numpy (1.18.3), scipy (1.4.1) and cx-freeze (6.1). Any help would be much appreciated!
Update: I used Dependency Walker to try and see what I am missing and it listed a file by the name of LIBOPENBLAS.SVHFG5YE3RK3Z27NVFUDAPL2O3W6IMXW.GFORTRAN-WIN32.DLL which cannot be found. All of the other dependencies have been copied into the build so it makes sense that this would be the missing one. Does anyone know where I can find this file?
I am trying to get a github repository to work on my pc. This repository is based on tensorflow-gpu. Currently, when I try to run the code, I get the following error:
Traceback (most recent call last):
File "D:/audio/deep-voice-conversion-master/deep-voice-conversion-master/convert.py", line 9, in <module>
from models import Net2
File "D:\audio\deep-voice-conversion-master\deep-voice-conversion-master\models.py", line 4, in <module>
import tensorflow as tf
File "D:\audio\deep-voice-conversion-master\deep-voice-conversion-master\venv\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "D:\audio\deep-voice-conversion-master\deep-voice-conversion-master\venv\lib\site-packages\tensorflow\python\__init__.py", line 59, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "D:\audio\deep-voice-conversion-master\deep-voice-conversion-master\venv\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
from google.protobuf import descriptor as _descriptor
File "D:\audio\deep-voice-conversion-master\deep-voice-conversion-master\venv\lib\site-packages\google\protoWbuf\descriptor.py", line 47, in <module>
from google.protobuf.pyext import _message
ImportError: DLL load failed: the specified module could not be found.
I am using pycharm on windows 10, with python 3.6.
I tried to follow these steps, but it seems outdated and I did not get it to work. I also prefer not to use anaconda, as this is a huge package and I only want to get this repository to work. So far, I have done the following:
I have installed all required packages (including the tensorflow and tensorflow-gpu packages) via pip.
I also downloaded CUDA 9.0 and cuDNN.
I have copied the files from cuDNN's bin, include and lib folders into the corresponding folders from CUDA.
I added the path to the cuda folder to the environment PATH from windows
I added the CUDA and cuDNN folder paths to the Content root folders of the project structure in pycharm (probably not helpful but someone somewhere suggested it)
I am new to tensorflow and I have no Idea what I have to do next. Any help will be appreciated.
protobuf seems to be a conda package. Try installing it with
conda install protobuf
Or
pip install protobuf