Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: DLL load failed on Windows 8.1 #445

Open
ivan-ushakov opened this issue May 31, 2017 · 21 comments
Open

ImportError: DLL load failed on Windows 8.1 #445

ivan-ushakov opened this issue May 31, 2017 · 21 comments

Comments

@ivan-ushakov
Copy link

How I install:

C:\Users\ivan>conda install Theano pygpu
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment C:\Users\ivan\Anaconda3:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-env-2.6.0            |                0          498 B
    theano-0.9.0               |           py36_0         4.0 MB
    ------------------------------------------------------------
                                           Total:         4.0 MB

The following NEW packages will be INSTALLED:

    pygpu:     0.6.4-py36_0
    theano:    0.9.0-py36_0

The following packages will be UPDATED:

    conda:     4.2.13-py36_0 conda-forge --> 4.3.21-py36_0

The following packages will be SUPERCEDED by a higher-priority channel:

    conda-env: 2.6.0-0       conda-forge --> 2.6.0-0

Proceed ([y]/n)? y

Pruning fetched packages from the cache ...
Fetching packages ...
conda-env-2.6. 100% |###############################| Time: 0:00:00  31.87 kB/s
theano-0.9.0-p 100% |###############################| Time: 0:00:01   3.30 MB/s
Extracting packages ...
[      COMPLETE      ]|##################################################| 100%
Unlinking packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################| 100%

How I check:

C:\Users\ivan>python
Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import theano
ERROR (theano.gpuarray): pygpu was configured but could not be imported or is too old (version 0.6 or higher required)
NoneType: None
>>> import pygpu
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\ivan\Anaconda3\lib\site-packages\pygpu\__init__.py", line 7, in <module>
    from . import gpuarray, elemwise, reduction
ImportError: DLL load failed: The specified module could not be found.

DLL location:

C:\Users\ivan>dir C:\Users\ivan\Anaconda3\pkgs\libgpuarray-0.6.4-vc14_0\Library\bin\gpuarray.dll

12.04.2017  03:22           194 048 gpuarray.dll
@abergeron
Copy link
Member

You seem to be mixing conda-forge and regular conda packages. Make sure you install theano and pygpu/libgpuarray from the same source as your python install.

pygpu is the name of the official conda package.

libgpuarray is the name of the conda-forge package.

@ivan-ushakov
Copy link
Author

ivan-ushakov commented May 31, 2017

I was thinking that if I use conda tool then I use same source as my python install. How can I check what is wrong?

Anyway, I removed pygpu, libgpuarray and theano and tried to install only theano:

C:\Users\ivan>conda install theano
Fetching package metadata ...........
Solving package specifications: .

Package plan for installation in environment C:\Users\ivan\Anaconda3:

The following NEW packages will be INSTALLED:

    libgpuarray: 0.6.4-vc14_0 [vc14]
    pygpu:       0.6.4-py36_0
    theano:      0.9.0-py36_0

Proceed ([y]/n)? y

As you see pygpu and libgpuarray installed together.

@abergeron
Copy link
Member

This seems ok because they now both come from the official packages.

Are you still having problems?

@ivan-ushakov
Copy link
Author

Yes, problem is still the same. Can't load DLL for some reason. Do you need anything from my side, environment variables, versions of tools?

@abergeron
Copy link
Member

Can you list the contents of C:\Users\ivan\Anaconda3\lib\site-packages\pygpu\

@ivan-ushakov
Copy link
Author

Sure. Here it is:

C:\Users\ivan>dir C:\Users\ivan\Anaconda3\Lib\site-packages\pygpu

31.05.2017  18:31    <DIR>          .
31.05.2017  18:31    <DIR>          ..
12.04.2017  03:43             1 773 basic.py
31.05.2017  18:31           349 599 blas.c
12.04.2017  03:43            49 664 blas.cp36-win_amd64.pyd
12.04.2017  03:43             4 534 blas_api.h
31.05.2017  18:31         1 055 991 collectives.c
12.04.2017  03:43           159 744 collectives.cp36-win_amd64.pyd
12.04.2017  03:43             1 332 collectives.h
12.04.2017  03:43             7 273 collectives_api.h
12.04.2017  03:43             6 739 dtypes.py
12.04.2017  03:43             3 167 elemwise.py
31.05.2017  18:31         1 787 516 gpuarray.c
12.04.2017  03:43           304 128 gpuarray.cp36-win_amd64.pyd
12.04.2017  03:43             1 961 gpuarray.h
12.04.2017  03:43            13 621 gpuarray_api.h
12.04.2017  03:43               808 numpy_compat.h
12.04.2017  03:43             4 050 operations.py
12.04.2017  03:43            10 177 reduction.py
31.05.2017  18:31    <DIR>          tests
12.04.2017  03:43             8 490 tools.py
12.04.2017  03:43               101 version.py
12.04.2017  03:43            10 304 _array.py
31.05.2017  18:31           438 301 _elemwise.c
12.04.2017  03:43            50 176 _elemwise.cp36-win_amd64.pyd
12.04.2017  03:43               748 __init__.py
31.05.2017  18:31    <DIR>          __pycache__

Also here is egg:

C:\Users\ivan>dir C:\Users\ivan\Anaconda3\Lib\site-packages\pygpu-0.6.4-py3.6.egg-info

31.05.2017  18:31    <DIR>          .
31.05.2017  18:31    <DIR>          ..
12.04.2017  03:43                 1 dependency_links.txt
12.04.2017  03:43               236 PKG-INFO
12.04.2017  03:43                14 requires.txt
12.04.2017  03:43               651 SOURCES.txt
12.04.2017  03:43                18 top_level.txt

@abergeron
Copy link
Member

Can you try to use Dependecy Walker (http://www.dependencywalker.com/) on gpuarray.cp36-win_amd64.pyd?

@ivan-ushakov
Copy link
Author

ivan-ushakov commented Jun 6, 2017

Ok, Here it is.
gpuarray.cp36-win_amd64.zip

@abergeron
Copy link
Member

According to the trace, it fails to load python36.dll. I don't think that this is right, especially when you run from python.

The funny thing is that it finds gpuarray.dll, so maybe a live tracing would be required to see what fails to load and why. I'm not too sure how to do that on windows however.

@ivan-ushakov
Copy link
Author

I found strange thing.

C:\Users\ivan\Anaconda3\pkgs

31.05.2017  14:18    <DIR>          libgpuarray-0.6.4-vc14_0
31.05.2017  14:17           248 285 libgpuarray-0.6.4-vc14_0.tar.bz2

...

31.05.2017  14:18    <DIR>          pygpu-0.6.4-py36_0
31.05.2017  14:17           587 512 pygpu-0.6.4-py36_0.tar.bz2

...

31.05.2017  16:16    <DIR>          theano-0.9.0-py36_0
31.05.2017  16:16         4 224 495 theano-0.9.0-py36_0.tar.bz2

C:\Users\ivan\Anaconda3\Lib\site-packages

31.05.2017  18:31    <DIR>          pygpu
31.05.2017  18:31    <DIR>          pygpu-0.6.4-py3.6.egg-info

31.05.2017  18:31    <DIR>          theano
31.05.2017  18:31    <DIR>          Theano-0.9.0-py3.6.egg-info

Do you know how pkg folder used in Anaconda Python? And why I have entries with different date?

@abergeron
Copy link
Member

pkg is the repository of conda packages that you have downloaded.
site-packges are those that are in you root conda env.

The dates are all the same, it's only the hour which varies a bit, but I don't think it's a problem of any kind.

Are you doing the tests in the "Anaconda command prompt" or just a regular shell?

@ivan-ushakov
Copy link
Author

I use regular shell (cmd). I just run python and execute import theano.

@abergeron
Copy link
Member

Can you try from the Anaconda command prompt?

@ivan-ushakov
Copy link
Author

ivan-ushakov commented Jun 6, 2017

I opened Anaconda command prompt, ran python and executed import theano and now it just print

ERROR (theano.gpuarray): pygpu was configured but could not be imported or is too old (version 0.6 or higher required)
NoneType: None

When I try import pygpu it shows error from my first message about DLL.

@abergeron
Copy link
Member

This is strange. Do you have another install of Theano somewhere?

Try running conda list theano and conda list pygpu.

@ivan-ushakov
Copy link
Author

Here is full output.
conda_list.txt

@abergeron
Copy link
Member

I'm sorry but I have no idea what's wrong.

You could try to completely remove anaconda and reinstall it if it's not too much of a hassle, but I have no guarantees that it will even help.

@ivan-ushakov
Copy link
Author

BTW

pkg is the repository of conda packages that you have downloaded.
site-packges are those that are in you root conda env.

Why I don't see libgpuarray in site-packages?

@abergeron
Copy link
Member

Because libgpuarray is a C library not a python package.

@ivan-ushakov
Copy link
Author

So it could be the source of problem. I will try to investigate this and return to you with results.

@abergeron
Copy link
Member

It is normal that there is no libgpuarray package in the site-packages directory. There shouldn't be one and it is not a source of problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants