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

Import Error #6567

Open
shahlaebrahimi opened this issue Feb 26, 2018 · 18 comments
Open

Import Error #6567

shahlaebrahimi opened this issue Feb 26, 2018 · 18 comments

Comments

@shahlaebrahimi
Copy link

shahlaebrahimi commented Feb 26, 2018

I would greatly appreciate if you could let me how to resolve the following error while importing theano, which is installed on windows 10 using anaconda.

C:\Users\Markazi.co\Anaconda3\python.exe "D:/mifs-master_2/MU/learning-from-imbalanced-classes-master/learning-from-imbalanced-classes-master/continuous/Imbalanced - Copy - Copy.py"

Traceback (most recent call last):
You can find the C code in this temporary file: C:\Users\Markazi.co\AppData\Local\Temp\theano_compilation_error_uvinxn23
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 75, in <module>
    raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 92, in <module>
    raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/mifs-master_2/MU/learning-from-imbalanced-classes-master/learning-from-imbalanced-classes-master/continuous/Imbalanced - Copy - Copy.py", line 19, in <module>
    import theano.tensor as T
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\__init__.py", line 110, in <module>
    from theano.compile import (
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\compile\__init__.py", line 12, in <module>
    from theano.compile.mode import *
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\compile\mode.py", line 11, in <module>
    import theano.gof.vm
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\vm.py", line 673, in <module>
    from . import lazylinker_c
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 127, in <module>
    preargs=args)
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 2359, in compile_str
    (status, compile_stderr.replace('\n', '. ')))
. 

Best regards,

@nouiz
Copy link
Member

nouiz commented Mar 3, 2018

I'm not sure what can help you. Can you remove the python file to not contain space? We didn't test that case and on windows, space handing can be difficult.

Maybe this won't fix the problem, but it could give a better error message.

Which version of Theano you use? Make sure to use 1.0.1

@shahlaebrahimi
Copy link
Author

Hi
Thanks.
Sorry, I don't know what you mean by removing the python file to not contain space.
However, I installed Theano 1.01.
Best regards,

@shahlaebrahimi
Copy link
Author

@nouiz Hi
Sorry my error is similar to this but it fixed here on Linux.

Best regards,

@nouiz
Copy link
Member

nouiz commented Mar 12, 2018

Can you delete your Theano cache? If that do not fix it, can you try this #6575 that give a better error message? You can manually copy the only changed file.

@nouiz
Copy link
Member

nouiz commented Mar 12, 2018

Also, you probably have a file with more detail on the error message. Check the full output, it should have the path to that file.

@shahlaebrahimi
Copy link
Author

Thanks a lot. Could you please let me know how to delete my Theano cache?
I posted my error completely. This error is also reported here
https://stackoverflow.com/questions/41146147/can-not-import-theano-after-installation-windows-10
and here
https://stackoverflow.com/questions/37279948/run-theano-on-python-3-5

@nouiz
Copy link
Member

nouiz commented Mar 12, 2018 via email

@nouiz
Copy link
Member

nouiz commented Mar 12, 2018 via email

@shahlaebrahimi
Copy link
Author

shahlaebrahimi commented Mar 13, 2018

@nouiz Sorry, I stopped all process. Then, I just run:
import theano.tensor as T

Error:

C:\Users\Markazi.co\Anaconda3\python.exe D:/mifs-master_2/MU/learning-from-imbalanced-classes-master/learning-from-imbalanced-classes-master/continuous/svc.py
Traceback (most recent call last):

  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 75, in <module>
You can find the C code in this temporary file: C:\Users\Markazi.co\AppData\Local\Temp\theano_compilation_error_d23m74lm
    raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 92, in <module>
    raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/mifs-master_2/MU/learning-from-imbalanced-classes-master/learning-from-imbalanced-classes-master/continuous/svc.py", line 1, in <module>
    import theano.tensor as T
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\__init__.py", line 110, in <module>
    from theano.compile import (
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\compile\__init__.py", line 12, in <module>
    from theano.compile.mode import *
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\compile\mode.py", line 11, in <module>
    import theano.gof.vm
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\vm.py", line 673, in <module>
    from . import lazylinker_c
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 127, in <module>
    preargs=args)
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 2359, in compile_str
    (status, compile_stderr.replace('\n', '. ')))
. 

Process finished with exit code 1

@shahlaebrahimi
Copy link
Author

shahlaebrahimi commented Mar 16, 2018

@nouiz Hi
According to this post, there is a problem with the newer version of MinGW:
My MinGw:
C:\Program Files\mingw-w64\x86_64-6.2.0-posix-seh-rt_v5-rev1\mingw64
Is the error due to it?

You can find the C code in this temporary file: C:\Users\Markazi.co\AppData\Local\Temp\theano_compilation_error__q6g2bid
Traceback (most recent call last):
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 75, in <module>
    raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 92, in <module>
    raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/mifs-master_2/MU/learning-from-imbalanced-classes-master/learning-from-imbalanced-classes-master/continuous/logit-plot1.py", line 1, in <module>
    import theano.tensor as T
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\__init__.py", line 110, in <module>
    from theano.compile import (
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\compile\__init__.py", line 12, in <module>
    from theano.compile.mode import *
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\compile\mode.py", line 11, in <module>
    import theano.gof.vm
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\vm.py", line 673, in <module>
    from . import lazylinker_c
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 127, in <module>
    preargs=args)
  File "C:\Users\Markazi.co\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 2359, in compile_str
    (status, compile_stderr.replace('\n', '. ')))
. 

Process finished with exit code 1

Thanks in advance.
Best regards,

@nouiz
Copy link
Member

nouiz commented Mar 16, 2018

The first line of the error message is:

You can find the C code in this temporary file: C:\Users\Markazi.co\AppData\Local\Temp\theano_compilation_error__q6g2bid

Can you send this file?

@shahlaebrahimi
Copy link
Author

shahlaebrahimi commented Mar 16, 2018

@nouiz I sent the requested file to the gmail, which is posted on this page. I also sent them to: theano-users@googlegroups.com
Thanks a lot.
Best regard,

@maciejkos
Copy link

maciejkos commented Mar 22, 2018

I have basically the same error message. I am also using Windows 10 and Anaconda.

Traceback (most recent call last):
You can find the C code in this temporary file: c:\users\christ~1\appdata\local\temp\theano_compilation_error_rzrplc
  File "C:/Users/Christine/PycharmProjects/eeg_test/main.py", line 2, in <module>
    import eeglearn.eeg_cnn_lib as eeglib
  File "C:\Users\Christine\Documents\GitHub\EEGLearn\eeglearn\eeg_cnn_lib.py", line 10, in <module>
    import theano
  File "C:\Users\Christine\.conda\envs\eeg_test\lib\site-packages\theano\__init__.py", line 110, in <module>
    from theano.compile import (
  File "C:\Users\Christine\.conda\envs\eeg_test\lib\site-packages\theano\compile\__init__.py", line 12, in <module>
    from theano.compile.mode import *
  File "C:\Users\Christine\.conda\envs\eeg_test\lib\site-packages\theano\compile\mode.py", line 11, in <module>
    import theano.gof.vm
  File "C:\Users\Christine\.conda\envs\eeg_test\lib\site-packages\theano\gof\vm.py", line 673, in <module>
    from . import lazylinker_c
  File "C:\Users\Christine\.conda\envs\eeg_test\lib\site-packages\theano\gof\lazylinker_c.py", line 127, in <module>
    preargs=args)
  File "C:\Users\Christine\.conda\envs\eeg_test\lib\site-packages\theano\gof\cmodule.py", line 2359, in compile_str
    (status, compile_stderr.replace('\n', '. ')))
. 

Process finished with exit code 1

Thanks

@shahlaebrahimi
Copy link
Author

shahlaebrahimi commented Mar 25, 2018

@maciejkos Sorry, have you tried these?
http://simranmetric.com/installing-theano-on-windows-10-python-3-5/
https://hsaghir.github.io/data_science/theano-on-windows/
http://ankivil.com/installing-keras-theano-and-dependencies-on-windows-10-python-34/
The second and third link respectively are for python 2.7 and python 3.4 but I couldn't find how to do it for python 3.5.
Thanks in advance.

@VargMon
Copy link

VargMon commented Mar 26, 2018

Might be off topic but I've had issues with the Anaconda Python distribution.... specifically about the bytecode not compiling correctly every time I first initialize the CPython... completely bizarre but nonetheless I noted that in the linked site @shahlaebrahimi posted, they used MiniConda.

:)

@zhangk15
Copy link

I have the exact same error with you on windows and anaconda. And it works well after the following command:

conda install mingw libpython

@cpoptic
Copy link

cpoptic commented Apr 20, 2018

conda install mingw libpython

Installing mingw and libpython also worked for me to solve the problem on a Windows 10 machine running Theano in a conda virtual environment.

@NikhilCodes
Copy link

Hey I tried to build an app(dependency: Theano) using cx_freeze, but getting the same error as the question. But it works fine when i run it in IDLE (import theano), and throws error in exe form.
Any HELP!!

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

7 participants