1

How can I change/upgrade numpy in my Anaconda distribution from 32 bits to 64 bits?

My Windows 10 installation of Anaconda installed a 64 bit version of Python. But it also apparently has installed a 32 bit version of 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.
>>>   

resulting in:

>>> 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
>>>

This is what I currently have

(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

I believe that this is the cause of my problem I reported here

Anaconda/Orange3 produces OSError: [WinError 193] %1 is not a valid Win32 application

Levon
  • 138,105
  • 33
  • 200
  • 191

1 Answers1

0

In case anyone else comes across this, I solved this problem. The issue was with some left-over directories from a previous uninstall of Python 3.7 that didn't get deleted during the process.

File "C:\Users\i7\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py",

Once I deleted this directory (C:\Users\i7\AppData\Roaming\Python\Python37) it all worked. Credit goes to a comment in How to use anaconda packages for python 3.7 on windows 10? by @FlyingTeller

Levon
  • 138,105
  • 33
  • 200
  • 191