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

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.

Related

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

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?

What does this stack trace tell me is wrong with my Tensorflow Installation

I have went through and installed CUDA, cuDNN, an followed the instructions to the best of my ability. I have added the environment variables I believe I need, but I still seem to have problems.
I have come as far as testing to see if tensorflow has been installed correctly. When pull up a command prompt, type python to use the shell, I type import tensorflow as tf.
I then get this stack trace, something I cannot make sense of to solve the problem myself. This is where I need the communities help:
>>> import tensorflow as tf
Traceback (most recent call last):
File "C:\Users\Troy\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
ctypes.WinDLL(build_info.cudart_dll_name)
File"C:\Users\Troy\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Troy\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\Troy\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Troy\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Users\Troy\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\self_check.py", line 82, in preload_check
% (build_info.cudart_dll_name, build_info.cuda_version_number))
ImportError: Could not find 'cudart64_90.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 9.0 from this URL: https://developer.nvidia.com/cuda-toolkit
Please try installing CUDA 9.0. the problem should be with the CUDA 9.1 version. You can download the driver from the following link : CUDA Toolkit 9.0
To uninstall CUDA:
Please run the following commands :
sudo apt-get --purge remove cuda
sudo apt autoremove
These commands should be able to uninstall cuda from your system.
If you have the cuDNN configured to work with GPU:
You can remove them just my deleting the files in the directories that you have copied to, during its setup.

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.

Missing required dependencies when running from CMD

My problem is as follows. I'm trying to package a python script a wrote to run on other computers with CX_freeze. After some fiddling I got the script packaged but when I went to run the code I got:
Miless-foobar-Pro:~ milesconn$ /Users/milesconn/\~/Documents/ IPgeolookupforXLSX ; exit;
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site- packages/cx_Freeze/initscripts/__startup__.py", line 14, in run
module.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site- packages/cx_Freeze/initscripts/Console.py", line 26, in run
exec(code, m.__dict__)
File "/Users/milesconn/Desktop/IPgeolookupforXLSX.py", line 1, in <module>
import sys
ModuleNotFoundError: No module named 'pandas'
logout
[Process completed]
Now this was quite confusing because if I ran the script from IDLE everything worked perfectly. I started trying to run the original script (the .py not the .app) from terminal with simply python IP* but I continued to get the ModuleNotFoundError I upgraded Pandas w/ Pip3 and everything is up to date, still no luck. The program however worked perfectly when run in IDLE. I went on searching for my problem and found this link. I followed the advice and added to the top of my program
import sys
sys.path.insert(1,'/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages')
import pandas as pd
import numpy as np
Still the program ran from IDLE perfectly like before and now when I ran it in Terminal got this error
Traceback (most recent call last):
File "IPgeolookupforXLSX.py", line 4, in <module>
import pandas as pd
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/__init__.py", line 19, in <module>
"Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']
Now I don't know what to do from here. I believe if I get the program to run from terminal correctly then it'll hopefully couple with CX_Freeze and run. Thanks.
tl;dr: .py script runs from IDLE perfectly but when run from terminal it returns a ImportError: Missing required dependencies ['numpy']

Python won't run due to ImportError: cannot import MAXREPEAT

I am new to python but have been using both IDLE and EricIDE for a few weeks without any major problems.
I was editing a program I had written that called random.randint() function and it wouldn't work.
Previously, this program had been working and I had not changed that call out.
I then loaded another program that uses the same function that had been working and it would not run either.
I tried to load the program in IDLE but IDLE wouldn't load. After trying several reboots and reloads EricIDE wouldn't load either. I noticed a black window popping up and disappearing quickly when I try to launch either IDE from my previously working desktop shortcuts.
Searching for help led me to run python shell from the windows command line by going to C:\python33\ and typing "python" to run python shell, I get:
File "C:\python33\lib\sre_constants.py", line 18, in (module)
from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT
I am using Windows 8 (new to it as well and still trying to figure it out).
At this point I'm assuming my problem is with my python installation since the python shell won't work. I have uninstalled and reinstalled Python 3.3.1 but the problem persists. I also deleted the .idlerc folder from my Users directory as suggested in another thread that was similar to my problem but that doesn't seem to have helped either.
Thank you for any help you can provide.
response to eryksun:
C:\Python33>python.exe -c "import sys; print(sys.path)"
Traceback (most recent call last):
File "C:\Python33\lib\site.py", line 70, in <module>
import re
File "C:\Python33\lib\re.py", line 122, in <module>
import sre_compile
File "C:\Python33\lib\sre_compile.py", line 14, in <module>
import sre_parse
File "C:\Python33\lib\sre_parse.py", line 17, in <module>
from sre_constants import *
File "C:\Python33\lib\sre_constants.py", line 18, in <module>
from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT
C:\Python33>python.exe -S -c "import sys; print(sys.path)"
['', 'C:\\Python33\\python33.zip', 'C:\\Python33\\DLLs',
'C:\\Python33\\lib', 'C:\\Python33']
Follow up to to eryksun:
C:\Python33>python.exe -S -c "import _imp; _sre = _imp.init_builtin('_sre');
print(_sre.MAXREPEAT)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'MAXREPEAT'
I suggest you uninstall. Completely remove C:\Python33 and also C:\Windows\System32\python33.dll. _sre is built in to the latter DLL. MAXREPEAT is set by its initialization functionPyInit__sre (Modules/_sre.c). Clearly, something is wrong there.
When you download the 3.3.1 installer, make sure you get the right binary for your platform, i.e. x86 for 32-bit Windows and X86-64 for 64-bit Windows.

Resources