Anaconda3-4.3.1 installation on Linux - Spyder won't launch (PyQt5.QtWebEngineWidgets) - linux

I just installed the above mentioned Anaconda version. Jupyter works fine, but I can't launch Spyder as I get
File "/proj/mianxx/anaconda3/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 "/proj/mianxx/anaconda3/bin//spyder", line 6, in <module>
sys.exit(spyder.app.start.main())
File "/proj/mianxx/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 103, in main
from spyder.app import mainwindow
File "/proj/mianxx/anaconda3/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 92, in <module>
from qtpy import QtWebEngineWidgets # analysis:ignore
File "/proj/mianxx/anaconda3/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 26, in <module>
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ImportError: /proj/mianxx/anaconda3/lib/python3.6/site-packages/PyQt5/../../../././libgsttag-1.0.so.0: undefined symbol: g_mutex_init
I am too much of a noob to take it from here...Any hints?
I've checked This GIT entry but I can't make much of it. It also seems old, despite being open.
EDIT
The issue appears to be related to tcsh, which is the default shell called.
If one issues
bash
LD_LIBRARY_PATH= spyder
This works and launches spyder correctly. However,
bash
spyder
will generate the same error as above.
Thanks to #Carlos Cordoba for his help.

Thanks for Carlos Cordoba's help, When I try to use:
LD_LIBRARY_PATH= spyder
in terminal, it really works but 'spyder' can't. Then I use:
sudo gedit ~/.bashrc
to open bashrc, write
export LD_LIBRARY_PATH= spyder:$LD_LIBRARY_PATH
save and open terminal with:
source ~/.bashrc
retry enter:
spyder
in terminal, works!
UPDATE
There is still something wrong when I write LD_LIBRARY_PATH= spyder in bashrc, every time when I open terminal, there is an error shows that space shouldn't write before spyder, but when I alter LD_LIBRARY_PATH= spyder into LD_LIBRARY_PATH=spyder, Spyder won't launch again, So there are two ways can solve this problem:
Don't mind see warning every time you open terminal
Use LD_LIBRARY_PATH= spyder open spyder

I found the answer (work with Ubuntu 18.04)
Check the version of pyqt
conda list pyqt
if it is 5.6.x
It won't work so I resorted to this simple command:
conda install pyqt=5.9.2
(and later also to
qt=5.9.5 qtpy=1.4.1 check all with conda list qt)
then you're good to launch spyder

More info on lixun's answer. In fact you may do
$ export LD_LIBRARY_PATH=
$ spyder
and it will work without any warning. Seasoned spyder/qt/anaconda specialists may be able to explain why. I do not feel this is a good solution. It is just a workaround.
I am using anaconda on Ubuntu 16.04.

Related

Cannont run PyGlossary on Windows10

Absolute noob here, so I apologize in advance for stupid questions.
I'm running Windows 10, I've got Python 3.7.3 and I have...
Successfully installed pyglossary-3.2.1
But I cannot run PyGlossary from the command line or the tkinter GUI. If I run any of the following lines
python3 pyglossary.pyw --help
python3 pyglossary.pyw --ui=tk
python3 pyglossary.pyw --version
Nothing happens and I don't get any sort of error message. I've also tried...
python pyglossary.pyw --help
and I get...
Traceback (most recent call last):
File "pyglossary.pyw", line 30, in
from pyglossary import core # essential
File "C:\mypath\pyglossary\pyglossary.pyw", line 30, in
from pyglossary import core # essential
ImportError: cannot import name 'core' from 'pyglossary' (C:\mypath\pyglossary\pyglossary.pyw)
I've checked Windows Path variables, but I think everything's ok there, and I'm able to run other python stuff. Thanks in advance.

I tried pip installing spyder terminal in windows and now spyder 4.1.3 won't open

I have used matlab, but I am only 2 weeks into Python. I downloaded anaconda 3.7 and am using spyder 4.1.3. I was following a youtube tutorial on python. I was doing well until the guy access the cmd prompt (I use Windows 10) from within his IDE.
I didn't know how to so I googled it and to do so I found on pypi.org that all I had to do was run pip install spyder-terminal in the cmd prompt. I tried this but at the end it said that I had a permissions error and to try the --user option. I copied and pasted the exact error and saw on git hub, to create an environment or run python -m pip install --user [INSERT PACKAGE NAME].
I don't really understand hat an environment is so I did the second --user way. I ran python -m pip install --user spyder terminal I got an error about a location not being in the path variable, so i just copied the file location that it referenced and copied it the the path. I then went to open up spyder 4.1.3 and i got the error
Traceback (most recent call last):
File "C:\Users\Aaron\anaconda3\lib\site-packages\qtpy\__init__.py", line 204, in
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\Aaron\anaconda3\Scripts\spyder-script.py", line 10, in
sys.exit(main())
File "C:\Users\Aaron\anaconda3\lib\site-packages\spyder\app\start.py", line 201, in main
from spyder.app import mainwindow
File "C:\Users\Aaron\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 53, in
requirements.check_qt()
File "C:\Users\Aaron\anaconda3\lib\site-packages\spyder\requirements.py", line 41, in check_qt
import qtpy
File "C:\Users\Aaron\anaconda3\lib\site-packages\qtpy\__init__.py", line 210, in
raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found"
I tried opening it again and got the same error. I then tried uninstalling an dre-installing spyder in the anaconda navigator and got the same error. I tried removing the location I added to path and running "pip uninstall spyder-terminal", it said it was removed and I go the same error.
If possible, I am seeking specific steps in layman's terms, because all my knowledge thus far has come from the first 2 hours of a "cool things in python" type video.

python 3 no module named _tkinter

I've been searching for it but could not find anything on the net on this topic.
When I'm working on a programm in python 3.5 which imports tkinter or pyglet I'm perfectly able to start it from the command line on my Linux Mint installation. As soon as I try to start it from pycharm or Visual Studio Code I get an error.
It is for tkinter:
Traceback (most recent call last): File "/home/b...", line 3, in <module>
import tkinter as tk
File "/usr/lib/python3.5/tkinter/__init__.py", line 35, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named '_tkinter'
Both, the tkinter and the pyglet script, are working when they are started from idle3 (with F5).
Can anyone help me out?
Best
B.
i'm having the same issue. The problem lie with Linux Mint Software Manager. If your vs code is install via Software Manager, it will be install in Flatpak virtual sandbox. Just download and run vs code from its homepage will do.

python module not found error

This question has been asked a few times, but the remedy appears to complicated enough that I'm still searching for a user specific solution.
I recently installed Quandl module using pip command. Even after successful installation my python idle is still showing
Traceback (most recent call last):
File "F:\Python36\Machine Learning\01.py", line 3, in <module>
import Quandl
ModuleNotFoundError: No module named 'Quandl'
I have used import command in my code.
I am using python 3.6.1 version.
I am working on a windows 10 Desktop.
I have also tried re-installation of module.
You can better navigate to your python scripts folder and open a command window there and try pip3 install quandl .Hope this helps.

How to install PyGObject on windows in a anaconda virtual env

I want to use Gtk with python under windows. I already have Anaconda installed on windows. In order not to mess up everything and to have some easiness uninstalling/reinstalling, I would like to have a virtual env created with conda, working with that Gtk installation. But I don't seems to be able to make it work.
Here is my process. I first create a raw Ananconda virtual env with
conda create -n gtk-exporter python
The virtual environment is located at C:\Anaconda3\envs\gtk-exporter.
I then download the latest windows installer for PyGObject at http://sourceforge.net/projects/pygobjectwin32/files/?source=navbar
I extract and execute the installer and tell it to use a portable python install at C:\Anaconda3\envs\gtk-exporter. I only select Base, GTK and Glade for installation. The installation finished in a second and says it's successful.
Then within windows' shell, I activate the new environment with activate gtk-exporter. However when I try to import gtk, it fails, not finding gi.repository.
>>> from gi.repository import Gtk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'gi'
What's wrong here ? C:\Anaconda3\envs\gtk-exporter\Lib\site-package contains a folder gnome with a lot of stuff including *.dlls, *.exe's and unix-looking folders like etc, lib or share, but I don't see a init.py or something pythonic. Am I missing a step.
Thank you for your help !
The problem was that I used python 3.5, whereas it is not supported. The installer should not have allowed me to install with python 3.5. I filed a bug report to signal it.
I solved the problem by uninstalling python 3.5 and installing python 3.4.

Resources