如何将 Anaconda 发行版中的 numpy 从 32 位更改/升级到 64 位?
我的 Windows 10 安装的 Anaconda 安装了 64 位版本的 Python。但它显然也安装了 32 位版本的 numpy。
(base) C:\Users\i7>python
Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
结果:
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\i7\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "C:\Users\i7\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py", line 23, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\i7\Anaconda3\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
>>>
这就是我现在拥有的
(base) C:\Users\i7>conda list | grep numpy
numpy 1.16.5 py37h19fb1c0_0
numpy-base 1.16.5 py37hc3f5095_0
numpydoc 0.9.1 py_0
我相信这就是我在此处报告的问题的原因
Anaconda/Orange3 produces OSError: [WinError 193] %1 is not a valid Win32 application
最佳答案
如果其他人遇到这个问题,我解决了这个问题。问题在于之前卸载 Python 3.7 时留下的一些目录在此过程中没有被删除。
File "C:\Users\i7\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py",
一旦我删除了这个目录(C:\Users\i7\AppData\Roaming\Python\Python37
),一切都正常了。感谢 How to use anaconda packages for python 3.7 on windows 10? 中的评论通过@FlyingTeller
关于python - Anaconda:Python 是 64 位,numpy 32 位 -> 冲突。如何获得 numpy 64 位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58736871/