Spyder 5 ModuleNotFoundError - anaconda

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.

Met with similar problem. I reverted back to previous version till the devs sort the problem out.
conda install spyder=4.2.5

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

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.

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.

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.

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

On Windows 10 using WinPython and Spyder 5.0.3. I was having this issue with a local module import.
The simple fix was that my PYTHONPATH had gotten reset in the upgrade, and adding back in the relevant folders fixed this.

Related

Unable to run Autokey Ubuntu 18.04

I am relatively new to Linux/Ubuntu (so please take it easy on me) and I am trying to install Autokey to use the text expansion functionality. I have tried installing it from the instructions on the Github page here - https://github.com/autokey/autokey#installation
However, no matter whether I follow the installation process under the Ubuntu/Mint/Debian section or the instructions to install via pip I cannot seem to get the program working.
The installation seems to be successful (running a 'which' command gives the path installed) but clicking on the icon does not launch the program.
I have also tried to install directly from Ubuntu/GNOME software manager but that also will not launch the program once installed.
I have tried installing both the GTK and QT frontends and neither will launch. I don't get an error message or anything. I have opened up the System Monitor to see if a process even appears (however briefly) and there's nothing.
Typing autokey-gtk into Terminal gives:
/usr/local/lib/python2.7/dist-packages/autokey/gtkapp.py:24: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk, Gdk, GObject, GLib
Traceback (most recent call last):
File "/usr/local/bin/autokey-gtk", line 20, in <module>
from autokey.gtkapp import Application
File "/usr/local/lib/python2.7/dist-packages/autokey/gtkapp.py", line 28, in <module>
import service, monitor
File "/usr/local/lib/python2.7/dist-packages/autokey/service.py", line 21, in <module>
from iomediator import Key, IoMediator
File "/usr/local/lib/python2.7/dist-packages/autokey/iomediator.py", line 107, in <module>
from interface import *
File "/usr/local/lib/python2.7/dist-packages/autokey/interface.py", line 29, in <module>
from Xlib import X, XK, display, error
ImportError: No module named Xlib
Can anyone please help? Thank you.
I am a newbie too and installed Autokey 0.90.4, which did not work for me either. Someone suggested I try 0.95.1 because the other version is 7 years old.
I installed the new version with some acrobatics from the Autokey Github page, using the PIP method. At 1st it did not work, but after doing import setuptools it did. That might be a coincidence since it was after installation of the Ak package itself.
I know this sounds convoluted, but I am not familiar (yet?) with Linux. Anyway 0.95 works for me.
install module python-xlib and it will work, like this:
On Deb:
apt install python3-xlib
You might later need python autokey module as well:
pip install autokey

Clean install of Scientific Python without reformatting the disk

1st, the Disclaimer: I looked at numerous questions here, there is question about uninstalling all pip–installed, uninstalling matplotlib, moving to 3.5 from 2.7, –– but I didn't find an answer to my specific problem. Sorry if I didn't look hard enough.
Basically, my problem is I have a mess of different packages installed by different means at different times. Manifestations of this are:
1) I can import numpy from python but not from Jupyter notebook:
------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-5a0bd626bb1d> in <module>()
----> 1 import numpy
ImportError: No module named numpy
2) I cannot import nltk:
...
File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (sklearn/utils/murmurhash.c:5029)
ValueError: numpy.dtype has the wrong size, try recompiling
likely many more.
I recently uninstalled jupyter and anaconda, installed anaconda again, - this didn't help.
I cannot uninstall numpy / scipy , although I can use them (?!?):
>:~%python -c 'from numpy.random import rand; print rand()'
0.946167984715
>:~%pip uninstall numpy
Cannot uninstall requirement numpy, not installed
I have two versions of Python:
2.7.11 under /usr/local/bin/ pointing to /usr/local/Cellar/python/2.7.11/bin/python
2.7.10 under /usr/bin/ pointing to
/System/Library/Frameworks/Python.framework/Versions
-- although the default is 2.7.10 (numpy works with it), and I think 2.7.11 was added by Anaconda (incorrectly, because it doesn't see numpy).
Yesterday I uninstalled everything I could think of, then upgraded to a new version of Mac OS (10.12.2 Sierra), and then re-installed anaconda – in vain.
I am close to reformatting the disk and starting from scratch.
Is there a better option?
Thank you! and sorry for so many details.
Not sure exactly on a MAC but these are the things to try on windows and it is probably similar on MAC.
Start with a clean install of anaconda then try "where python" and "where jupyter" (it is "which" instead of "where" on linux). This tells you where it is looking for the executables. Both should be subfolders of anaconda. If they are not check your PATH variable.
Now start python or jupyter; import sys and try sys.path. That tells you where python is looking for stuff. It should look only in anaconda sub folders.

Scipy installation windows 10

I have some difficulties trying to install Scipy for Python 3.5 on a Windows 10 machine and I hope I can find some help here. So here is what I have done so far.
I have downloaded the numpy+mkl for python 3.5 and 64bit version as well as the scipy0.18.1 for the same versions, from Gohlke's website
I installed the numpy+mkl whl with:
python -m pip install numpy-1.11.2+mkl-cp35-cp35m-win_amd64.whl
all goes well.
then I install the scipy package the same way like:
python -m pip install scipy-0.18.1-cp35-cp35m-win_amd64.whl
This also completes.
However, when I try to run python afterwards I get the following error:
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
File "C:\Python35\Lib\site-packages\scipy\io\__init__.py" , line 97, in <module>
File "C:\Python35\Lib\site-packages\scipy\io\matlab\__init__.py", line 13 in <module>
File "C:\Python35\Lib\site-packages\scipy\io\matlab\mio.py", line 8 in <module>
ImportError: No module named 'numpy'
I also get a pop-up that Python has stopped working.
I have tried a different order in which I installed the packages, but all lead to the error mentioned when Scipy is installed.
I also installed did this on a windows 7 machine and there it works.
Does anybody have any idea what causes this issue?
I also had some issues. So I just installed Anaconda3 insted of python directly.

Configparser error leads to crash of Spyder 3 under Python(x,y)

During its startup, Spyder3 IDE crashes under Python(x,y). I have installed a Python(x,y) distribution (2.7.10.0) of Python2.7 under Windows 7 and after updating the package spyder to the most recent version (with pip: V3.0.x), it does not restart anymore. Resetting the spyder config does not help.
It is reproducible as I checked it on 3 computers and also with the Enthought distribution, it has the same problem. Only under Anaconda, it keeps working properly.
The error message is stored in the contents of file spyder_crash.log:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 3001, in main
mainwindow = run_spyder(app, options, args)
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 2905, in run_spyder
main.setup()
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 1010, in setup
from xy.config import DOC_PATH as xy_doc_path
File "c:\python27\lib\site-packages\xy\config.py", line 40, in <module>
CONF = UserConfig('xy', defaults=DEFAULTS, version=__version__, subfolder='.xy')
File "c:\python27\lib\site-packages\xy\userconfig.py", line 110, in __init__
if version != self.get_version(version):
File "c:\python27\lib\site-packages\xy\userconfig.py", line 130, in get_version
return self.get(self.DEFAULT_SECTION_NAME, 'version', version)
File "c:\python27\lib\site-packages\xy\userconfig.py", line 269, in get
value = cp.ConfigParser.get(self, section, option, raw=self.raw)
File "c:\python27\lib\site-packages\backports\configparser\__init__.py", line 811, in get
d)
File "c:\python27\lib\site-packages\backports\configparser\__init__.py", line 384, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "c:\python27\lib\site-packages\backports\configparser\__init__.py", line 397, in _interpolate_some
rawval = parser.get(section, option, raw=True, fallback=rest)
TypeError: get() got an unexpected keyword argument 'raw'
PS: I see that I could post an issue directly on Github but there are over 600 issues open. Maybe there is someone who knows a fix directly.
Different causes that Spyder crashes:
Spyder IDE won't start WinPython-64bit- 2.7.10.2
Broken links and probably different cause - Spyder/Pythonxy crashes
Edit:
Installation details:
C:\Users\strpeter>pip install spyder
Successfully installed configparser-3.5.0 jupyter-core-4.2.1 nbformat-4.2.0
setuptools-30.0.0 spyder-3.0.2
When uninstalling configparser, as recommended in the comment below, pythonw.exe stops working during the initialization of spyder3. I have no details at hand to report about the crash.
C:\Users\strpeter>pip uninstall configparser
Uninstalling configparser-3.5.0:
c:\python27\lib\site-packages\backports\configparser\__init__.py
c:\python27\lib\site-packages\backports\configparser\__init__.pyc
c:\python27\lib\site-packages\backports\configparser\helpers.py
c:\python27\lib\site-packages\backports\configparser\helpers.pyc
c:\python27\lib\site-packages\configparser-3.5.0-py2.7-nspkg.pth
c:\python27\lib\site-packages\configparser-3.5.0-py2.7.egg-info
c:\python27\lib\site-packages\configparser.py
c:\python27\lib\site-packages\configparser.pyc
Proceed (y/n)? y
Successfully uninstalled configparser-3.5.0
(Spyder developer here) This is an error between PythonXY and Spyder. I opened an issue about it, which we're going to solve in Spyder 3.1.0 (to be released in mid January/2017).
This might be due to incompatibilities due to different Qt wrappers. To test this in Enthought Python, please open a Canopy Command Prompt (or otherwise ensure that Enthought Python is your default python). Then ensure that PyQt is installed and make it the default Qt wrapper:
enpkg pyqt
set QT_API=pyqt
Now does Spyder 3 run ok?

Installing pygame on Windows (custom Python location not supported?)

I am running Python 3.5 on Windows 8. I am trying to install pygame. I downloaded and ran
pygame-1.9.2a0.win32-py3.2.msi (6.4 Mb)
from
http://www.pygame.org/download.shtml
From python I get, after starting a new session:
>>> import pygame
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
import pygame
ImportError: No module named 'pygame'
How do I install? Was my PythonPath updated? Looking at sys.path, it doesn't look like it. How do I get Python to see the library? Where was the library installed? Thanks for the help.
Update1:
The first step i the pygame intsaller states "Select Python Installations - Select the locations where pygame-1.9.2a0 should be installed." Underneath that is a selection that states "Python from another location". This doesn't make sense to me. Anyone?
Update2: I solved the problem - I reinstalled python in the default location (it wasn't before). The pygame installer doesn't seem to support custom installations. Ok, fixed. Thanks all for the help.
Up to now, Windows binaries must match the Python binaries. ...py-3.2.msi is for 3.2 and will not work with 3.5. Either get a 3.5 binary from the site you already used or use pip to install pygame-1.9.2a0-cp35-none-win32.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/ Use pip install /? to get info on how to install from somewhere other than pypi. It might be easier to download the file to your machine first. The site above says a bit about this.
Make sure you have 32-bit python and pygame.

Resources