DaveWillis
DaveWillis

Reputation: 1

Error after upgrading Spyder to 4.0.1 with Anaconda on macOS: ModuleNotFoundError: No module named 'numpy'

I recently updated my version of Spyder to 4.0.1 with Anaconda on macOS Catalina. I use Zsh and initially the command

conda install spyder=4.0.1

did not work, so I followed this guide to get Zsh to recognise the conda command, which essentially involved downloading the anaconda command line installer and running

bash ~/Downloads/Anaconda3-2019.10-MacOSX-x86_64.sh
export PATH="/Users/myname/anaconda3/bin:$PATH"

then running

conda install spyder=4.0.1

to update Spyder. This seemed to work fine, the new version is stored in /users/myname/anaconda3/envs/spyder-4.0.1 and upon opening Anaconda-Navigator I was able to specify Spyder 4.0.1, although I had to change the "Applications on" option to "spyder" rather than "base (root)". I could then open Spyder 4.0.1 on the same Python 3.7 projects I had on Spyder 3.3.6, but they could no longer run due to the error

ModuleNotFoundError: No module named 'numpy'

This was not just for numpy, it also couldn't find scipy or matplotlib, although it could find time and sys. When I run

conda list

All of the modules are there, and Spyder 3.3.6 still runs fine, but for some reason the new version can't use them.

EDIT: Have resolved the issue. All the modules were had to be manually added to Spyder 4.0.1 in the Anaconda-Navigator window. On the left go to Environments, select spyder-4.0.1 and a list of installed modules appears. In the drop down menu select "Not installed" and select the modules you wish to have installed, then click apply. You can now open Spyder 4.0.1 and import the modules as required.

Upvotes: 0

Views: 1019

Answers (1)

George
George

Reputation: 39

You should update to python 3.7 and then update Spyder.

conda install python=3.7 anaconda=custom

Upvotes: 1

Related Questions