How to install pyqt5 on a virtual machine? - pyqt5

I have a google cloud platform virtual machine and I'm trying to run a python code using pyqt5 library.
I managed to install the miniconda distribution and all libraries I need (including pyqt5) but I'm having a problem while executing that code :
from PyQt5 import QtWebEngineWidgets
getting this error :
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
After searching in forums, I understood that it's because I may have a virtual machine (through SSH, OS : Ubuntu 19.04 amd64 disco image built on 2019-07-24) without window manager. I then installed the window manager Awesome but I got the same error.
I then tried unhopefully to solve the error by doing:
sudo apt update
sudo apt install libgl1-mesa-glx
as seen in a forum and I got a different error:
ImportError: libXss.so.1: cannot open shared object file: No such file or directory
but I think it's the same core problem.
Does anyone have an idea ?
Thank you for your help and your time !

Related

pymysql no module problem on mac os (conda install solution didn't work)

I'm a mac os user (and also a programming beginner )
I installed pymysql package via pip but got an error message from jupyter notebook saying (no module found : pymysql)
After, searching through the link below
(ModuleNotFoundError - PyMySQL for python 3) I assumed that the problem was that I installed the package via pip while using conda.
so after reinstalling it via conda I got the message below from the terminal.
'Collecting package metadata (current_repodata.json): done
Solving environment: done
All requested packages already installed.'
However, when I tried to run the codes again with hopes, got the same message again (no module pymysql found). Now I'm a bit lost. What else can I try to fix no module pymysql problem ?

matplotlib qt wsl ubuntu qt5

Faced problems when using a jupyter notebook and tried to do a simple plot using matplotlib.
Hit many errors,
ImportError: Failed to import any qt binding
Also tried installing some libraries in my WSL Ubuntu Linux
sudo apt-get install libgl1-mesa-glx
But didn't solve the problem:
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
After installing other packages I only got from Jupyter a message Kernel is dead.
How to solve issue?
TL;DR;
sudo apt-get install libxkbcommon-x11-0
More details:
After a lot of googling, what pointed me in the right direction was (this site)[https://forum.qt.io/topic/93247/qt-qpa-plugin-could-not-load-the-qt-platform-plugin-xcb-in-even-though-it-was-found/3] where SGaist's comment of doing
$ export QT_DEBUG_PLUGINS=1
$ jupyter qtconsole
Showed:
.../site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)
Which can be installed doing:
sudo apt-get install libxkbcommon-x11-0
And then it all worked....!
Hope this can help someone...

I am trying to simply connect to the ibapi (Interactive Brokers API), but I am having some technical troubles with Flask

I am trying to simply connect to the ibapi (Interactive Brokers API), but I am having some technical troubles with Python 3.7 .
What I did so far:
I installed the latest version for Windows 10 of the API
I ran C:\TWS API\source\pythonclient and run python setup.py install
I got:
ModuleNotFoundError: No module named 'ibapi'
when I try to import it
What I am doing wrong here and how can I fix this simple error?
My flask project is created in a virtual env named Ibconnect ( (IBconnect) C:\Users\Admin\dev\IBconnect> on the command Windows ) and I think that I have to install the python client here but I don't know how to do it.
Please try to use Anaconda - Spyder. In Anaconda prompt (just activates the conda environment) and navigate to the dir C:\TWS API\source\pythonclient and run python setup.py install

Installing PyQt5 from sources: Unable to import PyQt5.sip

I'm trying to build PyQt5 from the sources. I'm running fedora 28 and I installed Qt5 via dnf. Installing Sip following this seems OK. But when i try to configure PyQt i got this error:
# python3 configure.py -q /usr/bin/qmake-qt5
Querying qmake about your Qt installation...
Error: Unable to import PyQt5.sip. Make sure you have configured SIP to
create a private copy of the sip module.
According to the doc I did:
# python3 configure.py --sip-module private.sip
# python3 configure.py -q /usr/bin/qmake-qt5 -n private.sip
But i still get the error. So I'm guessing I'm not using it properly. Any suggestions ?
P.S: I know (and i did) that it can be done via pip but i'm facing the same problem than here
Are you trying to install sip-4.19.10 and PyQt5_gpl-5.11.1?
Try a combination of sip-4.19.8 and PyQt5_gpl-5.10.1.
https://sourceforge.net/projects/pyqt/files/PyQt5/
https://sourceforge.net/projects/pyqt/files/sip/

Pycharm. Trouble installing numpy-mlk for Windows

I'm new to Python and am trying to install numpy-mkl from Pycharm. I get the following error even though I upgraded 'pip' to version 8.1.1 from Pycharm.
Thanks!
http://i.stack.imgur.com/ipvJw.png
i don't believe numpy-mkl is in the repositories, so it can't be installed the way you're doing it.
if you're running windows, download the appropriate Numpy+MKL .whl file from Here. For me, on cpython 3.5 64-bit, the current file is numpy-1.11.1+mkl-cp35-cp35m-win_amd64.whl
then run:
pip install "numpy-1.11.1+mkl-cp35-cp35m-win_amd64.whl"
i'm not sure if the .whl file needs to be in the same folder as your python installation or pip.