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

Unable to use tensorflow because of error. #12969

Closed
HuviX opened this issue Feb 14, 2019 · 7 comments
Closed

Unable to use tensorflow because of error. #12969

HuviX opened this issue Feb 14, 2019 · 7 comments

Comments

@HuviX
Copy link

HuviX commented Feb 14, 2019

Hello.
I have created a new environment for tensorflow in Anaconda.
And

pip install tensorflow

Installation said to be successful but in fact I have some problems in numpy which I have already tried to solve by numpy reinstallation/version downgrade.

import numpy

as well as

import tensorflow

leads to:

Error message:

Traceback (most recent call last):
File "C:\Users\Maest\AppData\Local\Continuum\anaconda3\envs\tflow\lib\site-packages\numpy\core_init_.py", line 16, in
from . import multiarray
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 "", line 1, in
File "C:\Users\Maest\AppData\Local\Continuum\anaconda3\envs\tflow\lib\site-packages\numpy_init_.py", line 142, in
from . import add_newdocs
File "C:\Users\Maest\AppData\Local\Continuum\anaconda3\envs\tflow\lib\site-packages\numpy\add_newdocs.py", line 13, in
from numpy.lib import add_newdoc
File "C:\Users\Maest\AppData\Local\Continuum\anaconda3\envs\tflow\lib\site-packages\numpy\lib_init_.py", line 8, in
from .type_check import *
File "C:\Users\Maest\AppData\Local\Continuum\anaconda3\envs\tflow\lib\site-packages\numpy\lib\type_check.py", line 11, in
import numpy.core.numeric as nx
File "C:\Users\Maest\AppData\Local\Continuum\anaconda3\envs\tflow\lib\site-packages\numpy\core_init
.py", line 26, in
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try git clean -xdf (removes all
files not under version control). Otherwise reinstall numpy.

Original error was: DLL load failed: The specified module could not be found.

Numpy/Python version information:

Python version - '3.7.2 (default, Feb 11 2019, 14:11:50) [MSC v.1915 64 bit (AMD64)]'
Numpy version - I have already tried multiple versions: 1.5.3, 1.5.4, 1.6.1. And I get the same errors.

@mattip
Copy link
Member

mattip commented Feb 14, 2019

the information here about PATHs might be helpful. Please let us know if it is, so we can hone in on the real issue.

@HuviX
Copy link
Author

HuviX commented Feb 14, 2019

PATH=path\to\site-packages\numpy\.libs;%PATH%python -c "import numpy"
works well. And Lib\site-packages\numpy.libs exists and there is one file in it:
libopenblas.CSRRD7HKRKC3T3YXA7VY7TAZGLSWDKW6.gfortran-win_amd64.dll
What should I do next? Add ...\Lib\site-packages\numpy.libs to my PATH variable?

@HuviX
Copy link
Author

HuviX commented Feb 14, 2019

I am a bit confused about conversation you linked to, sorry.

@mattip
Copy link
Member

mattip commented Feb 14, 2019

Could you try one more thing (this is what we do inside numpy)? We append, rather than prepend the library to the path inside numpy:

PATH=%PATH%;path\to\site-packages\numpy\.libs
python -c "import numpy"

So if prepending the path works, and appending does not, there is something strange about your path. If appending works, there is something strange in the way we set the PATH inside numpy.

@HuviX
Copy link
Author

HuviX commented Feb 14, 2019

This also works well. Actually, it doesn't throw me any exceptions/errors :)

@mattip
Copy link
Member

mattip commented Feb 14, 2019

Strange. so something is wrong with setting os.environ['PATH'] from python. A work-around for you is to set that path before calling python. It is more worrying for us that the python (apparently from 3 days ago?) you are using changed its behaviour. Where is it from?

@mattip
Copy link
Member

mattip commented Feb 14, 2019

Ahh, this is ContinuumIO/anaconda-issues#10629 which is a copy of ContinuumIO/anaconda-issues#10628

@HuviX HuviX closed this as completed Feb 15, 2019
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