CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Cannot import cntk after update to cntk-2.0.beta15.0

Open aFuerst opened this issue 9 years ago • 4 comments

When importing cntk it throws this ImportError. It started after I updated cntk to the newest version. Running on Windows 10 both in powershell and pyscripter

Traceback (most recent call last): File "c:\repos\cntk\bindings\python\cntk\cntk_py.py", line 15, in swig_import_helper return importlib.import_module(mname) File "C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py35\lib\importlib_init_.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 956, in _find_and_load_unlocked ImportError: No module named 'cntk._cntk_py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "c:\repos\cntk\bindings\python\cntk_init_.py", line 10, in from .core import * File "c:\repos\cntk\bindings\python\cntk\core.py", line 11, in from . import cntk_py File "c:\repos\cntk\bindings\python\cntk\cntk_py.py", line 18, in _cntk_py = swig_import_helper() File "c:\repos\cntk\bindings\python\cntk\cntk_py.py", line 17, in swig_import_helper return importlib.import_module('cntk_py') File "C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py35\lib\importlib_init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: DLL load failed: The specified procedure could not be found.

aFuerst avatar Mar 15 '17 23:03 aFuerst

Hi @aFuerst, I think you may have the PYTHONPATH environment variable set up from previously setting up CNTK build from source. Can you try unsetting? Unfortunately, PYTHONPATH, if it's there, it will take precedence over the CNTK version installed through binary installation.

Thanks, Mark

mahilleb-msft avatar Mar 16 '17 08:03 mahilleb-msft

Removing that from the path solved it, thank you!

aFuerst avatar Mar 17 '17 19:03 aFuerst

Same error. I installed everything under Python 3.5 virtual environment. I got same error when I tried to install the samples. I can see the modules are installed in the correct folder

myenv3.5\Lib\site-packages

03/27/2017 05:07 PM

cntk 03/27/2017 05:07 PM cntk-2.0.beta15.0.dist-info 03/27/2017 05:07 PM 30,961,664 _cntk_py.cp35-win_amd64.pdb 03/27/2017 05:07 PM 4,692,992 _cntk_py.cp35-win_amd64.pyd

zsong avatar Mar 27 '17 21:03 zsong

Hey @mahilleb-msft I met the same error. But there is no PYTHONPATH environment variable in my system. Could you help me? Thank you. Uploading environmentVariable.PNG… error

HnlyWk avatar Mar 30 '17 09:03 HnlyWk