[WinError 193] %1 不是有效的 Win32 应用程序问题解决
生活随笔
收集整理的這篇文章主要介紹了
[WinError 193] %1 不是有效的 Win32 应用程序问题解决
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在cmd中執行from sklearn.datasets import load_iris竟然報錯了:
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "C:\Users\resus\AppData\Local\Programs\Python\Python38\lib\site-packages\sklearn\__init__.py", line 82, in <module>from .base import cloneFile "C:\Users\resus\AppData\Local\Programs\Python\Python38\lib\site-packages\sklearn\base.py", line 13, in <module>import numpy as npFile "C:\Users\resus\AppData\Roaming\Python\Python38\site-packages\numpy\__init__.py", line 143, in <module>from . import _distributor_initFile "C:\Users\resus\AppData\Roaming\Python\Python38\site-packages\numpy\_distributor_init.py", line 26, in <module>WinDLL(os.path.abspath(filename))File "C:\Users\resus\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 373, in __init__self._handle = _dlopen(self._name, mode) OSError: [WinError 193] %1 不是有效的 Win32 應用程序。我回想了剛才的操作:
我卸載了python3.8-32,也就是卸載了32位的python3.8,然后下載了64位的python3.8。為了使用sklearn,我執行了pip install sklearn,然后就報了上面的錯。
從上面的報錯信息,尤其是這個:
File "C:\Users\resus\AppData\Roaming\Python\Python38\site-packages\numpy\_distributor_init.py", line 26, in <module> WinDLL(os.path.abspath(filename))我追蹤了C:\Users\resus\AppData\Roaming\Python\Python38\這個目錄:
為什么還是2021年的文件,我明明剛剛執行了pip install sklearn?,F在要做的就是把C:\Users\resus\AppData\Roaming\Python刪掉,重新執行pip install sklearn。
這就解決問題了。
如果你之前還執行過pip install jupyter notebook,那就也要把C:\Users\resus\AppData\Roaming\jupyter然后重新下載。
總結
以上是生活随笔為你收集整理的[WinError 193] %1 不是有效的 Win32 应用程序问题解决的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java graphics颜色_在Jav
- 下一篇: 并发辅助类