1

I have installed XGBoost on Windows 10 today, and it works well when I import it in python running in a common cmd prompt.

But when I use Jupyter Notebook or the Anaconda Prompt and Python, it shows the error [WinError 193] %1 is not a valid Win32 application.

I have tried where python in cmd and anaconda prompt, and that's the same. I also have tried to print sys.path in Python, and that's the same too.

Patrick
  • 1,046
  • 2
  • 10
  • 31
coffee
  • 21
  • 3
  • when i open `jupyter notebook` in `cmd` , i can import xgboost again. – coffee Jun 26 '18 at 12:34
  • i found that when i open jupyter in windows start menu,it could't work.And when i copy it to anywhere,and open it in a folder , it can work.So,what caused this? – coffee Jun 26 '18 at 12:53
  • I experienced the same issue when trying to do ``import mxnet`` in Python 3.7.1 on Windows 10. However, if I open the environment's prompt using the conda navigator, everything works fine. Would be helpful to know the reason. – Patrick Feb 27 '19 at 11:55
  • I found out that there is a difference in the `PATH` environment variable. I compared the output of `echo %PATH%` from the Anaconda Prompt (opened using the Start Menu link) to the one opened in the Anaconda Navigator (clicking on the 'play' button right next to the environment. The following entries in PATH were missing in my case: `C:\tools\Anaconda3;C:\tools\Anaconda3\Library\bin;C:\tools\Anaconda3\Library\mingw-w64\bin;C:\tools\Anaconda3\Library\usr\bin;C:\tools\Anaconda3\Scripts;` After adding them, I could successfully do `import mxnet`. – Patrick Feb 27 '19 at 17:08

0 Answers0