Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spyder 5 ModuleNotFoundError

I have just updated my spyder4 to spyder5 as:

conda update spyder

as I try to launch spyder it gives an Error : No module named 'qdarkstyle.colorsystem'

Here is the complete information :

Traceback (most recent call last):
  File "/home/sina/anaconda3/envs/py37/bin/spyder", line 11, in <module>
    sys.exit(main())
  File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/app/start.py", line 210, in main
    from spyder.app import mainwindow
  File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 72, in <module>
    from spyder.app import tour
  File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/app/tour.py", line 37, in <module>
    from spyder.utils.qthelpers import add_actions, create_action
  File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/utils/qthelpers.py", line 34, in <module>
    from spyder.utils.icon_manager import ima
  File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/utils/icon_manager.py", line 23, in <module>
    from spyder.utils.palette import QStylePalette, SpyderPalette
  File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/utils/palette.py", line 12, in <module>
    from qdarkstyle.colorsystem import Blue, Gray
ModuleNotFoundError: No module named 'qdarkstyle.colorsystem'

I would appreciate any comments on it.

like image 677
Sinooshka Avatar asked Apr 05 '21 15:04

Sinooshka


People also ask

How do I install packages on Spyder 5?

How to install libraries / packages / modules? First open Spyder and click Tools --> Open command prompt. You should see the Command Window appear in the bottom right of your screen. Here we install the Python package seaborn as an example.

How do I install Spyder 5 anaconda?

Running with Anaconda On other platforms, open Anaconda Navigator, scroll to Spyder under Home , and click Launch . If Spyder does not launch via this method or you prefer to use the command line, open Anaconda Prompt (Windows) or your terminal (other platforms), type conda activate base then spyder .

How do I fix the import error on Spyder?

For any libraries that you want to add that aren't included in the default search path of spyder (whatever that is) you need to go into Tools and add a path to EACH library via the PYTHONPATH manager. You'll then need to update the module names list from the same menu and restart spyder before the changes take effect.

Do you encounter the modulenotfounderror within the Spyder IDE?

Do you encounter the ModuleNotFoundError ModuleNotFoundError within the Spyder IDE? It sounds like you are installing gurobipy gurobipy into a Python environment that is different from the Python environment used by Spyder. You can check by running the following code in Spyder: which is where you've installed the gurobipy gurobipy package.

How to set up Spyder to download modules from local machine?

In fact, it is enough to set up on “Tool/PYTHONPATH manager” on Spyder the path of where your local machine is downloading and storing the installed modules via pip, save, close and re-launch Spyder. Easy, no? :) Here some screenshots for guidance:

Why am I getting “modulenotfounderror” when importing via pip?

But when launching the script I received the error: “ModuleNotFoundError” It seems a common problem for many that, when importing via “pip install module_xxx” missing Python modules on a local machine, by default they are not linked with Spyder.

How do I install Spyder in Python?

1. Download and Install Python 3.7.2 2. Open cmd 3. `pip install spyder` 4. `python` 5. `import spyder; spyder.app.start.main ()` What is the expected output? What do you see instead? Expected opening the GUI, but error occurred.


Video Answer


6 Answers

Met with similar problem. I reverted back to previous version till the devs sort the problem out.

conda install spyder=4.2.5
like image 116
BRIGHT Avatar answered Oct 22 '22 16:10

BRIGHT


Same problem on Win. To rollback, using miniconda command is the same:

conda install spyder=4.2.5

If you have activated a dedicated environment (named "xyz" here) first go to "base" and update the package repository (in miniconda its conda update conda), then activate the environment you want to operate on. Note: the package repository resides only in "base", however you can have as many custom environments, each installing and running its own version of Sypder (and any other packages installed, dedicated to that environment)

activate base  #go to the base to update the package repository first
conda update conda #in miniconda just update conda, not anaconda
activate xyz 
conda install spyder=4.2.5

Version 5 reportedly unstable till May-June

For all people that have this problem right now: if you want to use a very stable and well tested Spyder version, please stay with our latest version of Spyder 4 (we plan to maintain it for two more months with small bug fixes). Spyder 5 is still a work in progress and it'll take us two or three months until reaches the same level of stability. ccordoba12 https://github.com/spyder-ide/spyder/issues/15113

If you want to play with 5.0 first in a new environment named "tmp":

conda create --name tmp
activate tmp
conda install spyder=5.0.0

Later, can easily blow away that entire environment and everything in it.

conda env remove --name tmp
like image 7
rjlabs Avatar answered Oct 22 '22 15:10

rjlabs


I tried conda install -c conda-forge qdarkstyle=3.0.2 and it worked. But yeah there are few other bugs but spyder does seem to start.

like image 6
shreyas kamath Avatar answered Oct 22 '22 15:10

shreyas kamath


They notified me that the problem had been fixed and how to get a working version. The remedy is

conda install spyder=5.0.0=*_1

I did so and it is working as expected.

like image 2
John Neff Avatar answered Oct 22 '22 15:10

John Neff


On windows 10 using conda install qdarkstyle=3.0.2

return spyder to ver 4.2.3, but it is working. Anaconda typically fix such a bugs after few days.

like image 1
user1889297 Avatar answered Oct 22 '22 17:10

user1889297


I tried downgrading qdarkstyle package using conda install qdarkstyle 2.8.1 and it worked for me. Win 10 64 bit anaconda spyder IDE

like image 1
Zee Avatar answered Oct 22 '22 17:10

Zee