Class RunLoopModeTracker is implemented in both locations. Can't open Spyder - anaconda

I have no idea what I'm doing.
MacOS Version 10.13.4 and Python 3.7.3
I had anaconda installed and was using spyder fine, but I thought I'd install spyder-terminal using command pip install spyder-terminal because I thought that's how I'd get the terminal to show? Anyways now when I try opening spyder, I get this error:
objc[1685]: Class RunLoopModeTracker is implemented in both /anaconda3/lib/python3.7/site-packages/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x117d8e270) and /anaconda3/lib/libQt5Core.5.dylib (0x11fabda80). One of the two will be used. Which one is undefined.
Traceback (most recent call last):
File "/anaconda3/bin/spyder", line 11, in <module>
sys.exit(main())
File "/anaconda3/lib/python3.7/site-packages/spyder/app/start.py", line 186, in main
from spyder.app import mainwindow
File "/anaconda3/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 90, in <module>
from qtpy import QtWebEngineWidgets # analysis:ignore
File "/anaconda3/lib/python3.7/site-packages/qtpy/QtWebEngineWidgets.py", line 22, in <module>
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ValueError: PyCapsule_GetPointer called with incorrect name
I tried uninstalling anaconda and then re-installing/updating and re-installing spyder, but I'm still unable to open. Anyone know how to fix this?

Related

Unable to run anaconda neither anaconda-prompt on Windows

I have a following problem. I am not able to run anaconda navigator, neither anaconda-prompt after anaconda3 installation.
Nothing happens when I click on anaconda-navigator.exe as saved in C:\Users\misak\anaconda3\Scripts. When I check environmental variables paths I have there C:\Users\misak\anaconda3\Scripts.
When I try to run anaconda navigator from cmd I get this error:
C:\Users\misak>anaconda-navigator
Traceback (most recent call last):
File "C:\Users\misak\anaconda3\lib\site-packages\qtpy\__init__.py", line 204, in <module>
from PySide import __version__ as PYSIDE_VERSION # analysis:ignore
ModuleNotFoundError: No module named 'PySide'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\misak\anaconda3\Scripts\anaconda-navigator-script.py", line 6, in <module>
from anaconda_navigator.app.main import main
File "C:\Users\misak\anaconda3\lib\site-packages\anaconda_navigator\app\main.py", line 22, in <module>
from anaconda_navigator.utils.conda import is_conda_available
File "C:\Users\misak\anaconda3\lib\site-packages\anaconda_navigator\utils\__init__.py", line 15, in <module>
from qtpy.QtGui import QIcon
File "C:\Users\misak\anaconda3\lib\site-packages\qtpy\__init__.py", line 210, in <module>
raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found
I tried to reinstall Anaconda many times, co the problem seems to be somewhere else. Can you help my please?

Spyder on my mac recently stopped working and gives me error messages to the terminal as soon as I launch it

I'm running High Sierra on my Mac. I have python versions 2.7, 3.6 and 3.7. I have conda environments for each version. I had been using Spyder 3.3.2 a lot and really liked it. Recently however it stopped working. Best I can recall the problems started when I tried upgrading to Spyder 4.0. I've deleted Anaconda and reloaded it to no avail. I've tried it on Python 2.7 and 3.6 and I get the same error messages.
What I've tried: Uninstall and install spyder. I've reloaded pyqt and it loaded with no errors. I deleted and reinstalled Anaconda.
Can anyone tell me what I need to do? The error messages are shown below.
[py36] $ spyder
Traceback (most recent call last):
File "/Users/johnny/anaconda3/envs/py36/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 22, in <module>
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/johnny/anaconda3/envs/py36/bin/spyder", line 11, in <module>
sys.exit(main())
File "/Users/johnny/anaconda3/envs/py36/lib/python3.6/site-packages/spyder/app/start.py", line 186, in main
from spyder.app import mainwindow
File "/Users/johnny/anaconda3/envs/py36/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 90, in <module>
from qtpy import QtWebEngineWidgets # analysis:ignore
File "/Users/johnny/anaconda3/envs/py36/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in <module>
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'
[johnny:~] [py36] 2s 1 $
I found a solution, more of a workaround I suppose. I completely deleted my anaconda3 directory and returned to the Anaconda home page and reinstalled anaconda3. Now Spyder runs fine.

sklearn: ImportError: DLL load failed: The specified module could not be found

Ive updated my Python version from 3.5.4 to 3.6.6 (in Anaconda 3) and now the line
from sklearn.metrics.pairwise import cosine_similarity
causes the following error:
Traceback (most recent call last):
File "<ipython-input-3-743ac88bcf9a>", line 1, in <module>
from sklearn.metrics.pairwise import cosine_similarity
File "F:\Program Files\lib\site-packages\sklearn\__init__.py", line 64, in <module>
from .base import clone
File "F:\Program Files\lib\site-packages\sklearn\base.py", line 13, in <module>
from .utils.fixes import signature
File "F:\Program Files\lib\site-packages\sklearn\utils\__init__.py", line 13, in <module>
from .validation import (as_float_array,
File "F:\Program Files\lib\site-packages\sklearn\utils\validation.py", line 22, in <module>
from ..utils.fixes import signature
File "F:\Program Files\lib\site-packages\sklearn\utils\fixes.py", line 83, in <module>
from scipy.special import boxcox # noqa
File "F:\Program Files\lib\site-packages\scipy\special\__init__.py", line 640, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
Im on Windows 7, 64-bit; previously the line worked fine, and other packages (Pandas, Numpy etc) still work, so it doesn't appear to be a PATH issue as some have suggested.
Ive seen numerous similar questions but all solutions have so far failed. E.g.
roll the installation back to Python 3.5.4,
uninstall & re-install Pandas, Numpy, Scipy and Sklearn, also update MKL/MKL-RT.
The changes suggested in Error when trying to import sklearn modules : ImportError: DLL load failed: The specified module could not be found
were already implemented
Does anyone have any further suggestions (specific to Anaconda etc)?
I solved it, and (in my case) the problem was scipy, not sklearn.
What i did was uninstall scipy with conda: conda remove --force scipy, and then install it with pip: pip install scipy. That worked for me.

catch_config_error while trying to run ipython3

I'm getting the following error trying to run ipython3.
catch_config_error() missing 1 required positional argument: 'app'
I first got it on my Mac (python36). As my system has all sorts of customizations, I tried it again on a Linux system (Centos 7.4). I install ipython using pip3 and everything seemed to install cleanly. (On the same system, if i do this with python2, it seems to work.
Complete error log:
[scott] ipython3
Traceback (most recent call last):
File "/usr/bin/ipython3", line 7, in <module>
from IPython import start_ipython
File "/usr/lib/python3.4/site-packages/IPython/__init__.py", line 54, in <module>
from .core.application import Application
File "/usr/lib/python3.4/site-packages/IPython/core/application.py", line 23, in <module>
from traitlets.config.application import Application, catch_config_error
File "/usr/lib/python3.4/site-packages/traitlets/config/__init__.py", line 6, in <module>
from .application import *
File "/usr/lib/python3.4/site-packages/traitlets/config/application.py", line 120, in <module>
class Application(SingletonConfigurable):
File "/usr/lib/python3.4/site-packages/traitlets/config/application.py", line 291, in Application
def initialize(self, argv=None):
TypeError: catch_config_error() missing 1 required positional argument: 'app'
This is happening because traitlets relies on a package called 'decorator' that was just updated from 4.1.2 to 4.2.0 and broken its backward compatibility.
If you're using a requirements file or pip, install decorator==4.1.2 before installing IPython.
I tried in Ubuntu 16.04.
I also had the same problem (Python 3.6)
I tried again today.
$ sudo -H pip3 install --upgrade ipython
Then, decorator 4.2.1 is newly installed and the problem is solved.

While importing pyplot from matplotlib it hangs

I am trying to import pyplot but my python code will not run and gets stuck at the following spot:
from matplotlib import pyplot as plt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "matplotlib/pyplot.py", line 24, in <module>
import matplotlib.colorbar
File "matplotlib/colorbar.py", line 29, in <module>
import matplotlib.collections as collections
File "matplotlib/collections.py", line 23, in <module>
import matplotlib.backend_bases as backend_bases
File "matplotlib/backend_bases.py", line 50, in <module>
import matplotlib.textpath as textpath
File "matplotlib/textpath.py", line 11, in <module>
import matplotlib.font_manager as font_manager
File "matplotlib/font_manager.py", line 1356, in <module>
_rebuild()
File "matplotlib/font_manager.py", line 1341, in _rebuild
fontManager = FontManager()
File "matplotlib/font_manager.py", line 989, in __init__
self.ttffiles = findSystemFonts(paths) + findSystemFonts()
File "matplotlib/font_manager.py", line 318, in findSystemFonts
for f in get_fontconfig_fonts(fontext):
File "matplotlib/font_manager.py", line 275, in get_fontconfig_fonts
output = pipe.communicate()[0]
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 791, in communicate
stdout = _eintr_retry_call(self.stdout.read)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call
return func(*args)
I have tried uninstalling matplotlib using pip so that I can reinstall the package but that also throws a lengthy list of errors. I am running this on my Mac OSX 10.11.
Better use Conda.
I had this problem too [in windows]. I uninstalled and reinstalled python completely. Then, it was perfect. I think, it is because of corrupt files. Still, I moved to conda environment. It is more smooth and comfortable.
Download Anaconda from Scipy page
Open Conda command prompt
Use the code: -conda install pymc pymc
This code installs Conda environment, Scipy, Pymc, Numpy, matplotlib and setup tools
If you want only matplotlib, you can use pip install matplotlib.
It works good for me.
If you want to re-work on existing framework, better uninstall python setup and reinstall. Then try pip install. It works smoothly.
Hope this helps.
I ran into from matplotlib import pyplot as plt hanging on a remote Linux machined due to having X11 forwarding setup on the remote (client), but forgetting to start the X11 server locally. On Windows, I started XMing and was able to proceed.

Resources