简体   繁体   中英

How to fix"OSError: [WinError 193] %1 is not a valid Win32 application"

I'm trying to follow a tutorial on how to get started with machine learning and had to install the Scipy script, I installed it using Pip through command prompt. I kept getting this error, how would I add these scripts to PATH.

# Check the versions of libraries

# Python version

# scipy
import scipy
print('scipy: {}'.format(scipy.__version__))
# numpy
import numpy
print('numpy: {}'.format(numpy.__version__))
# matplotlib
import matplotlib
print('matplotlib: {}'.format(matplotlib.__version__))
# pandas
import pandas
print('pandas: {}'.format(pandas.__version__))
# scikit-learn
import sklearn
print('sklearn: {}'.format(sklearn.__version__))

Below is the error:

  File "c:\Users\chris\Desktop\Computer Science\ML_Test.py", line 6, in <module>
    import scipy
  File "C:\Users\chris\AppData\Roaming\Python\Python37\site-packages\scipy\__init__.py", line 62, in <module>
    from numpy import show_config as show_numpy_config
  File "C:\Users\chris\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 140, in <module>
    from . import _distributor_init
  File "C:\Users\chris\AppData\Roaming\Python\Python37\site-packages\numpy\_distributor_init.py", line 26, in <module>
    WinDLL(os.path.abspath(filename))
  File "C:\Users\chris\AppData\Local\Programs\Python\Python37-32\lib\ctypes\__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

I have a similar issue. From some other posts, is seems this is linked to a dll pb. However, I have no idea which dll is involved, and how to replace it with the appropriate one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM