ImportError: No module named PyQt5 : python3 - python

I was trying to learn how to use PyQt5 but at the moment that i want to run my code i got this error
ImportError: No module named PyQt5
I searched about it and i try all the possible solutions but im not able to fix it.
When i run
pip3 install PyQt5
I get this
Requirement already satisfied: PyQt5 in /usr/lib/python3/dist-packages (5.12.3)
And if i run
python --version
I get
Python 3.7.5
Now i dont know what to do. I'm using Pop_OS 19.10

Related

FlightRadarAPI not found as a module

I am trying to use the FlightRadar24 API as described in this link:
https://pypi.org/project/FlightRadarAPI/#description
I have followed the steps as outlined, however, when trying to run the following simple script, I get an error saying "No Module named 'FlightRadar24':
from FlightRadar.api import FlightRadar24API
fr_api = FlightRadar24API()
However, I re-checked whether the module has been installed, which is true. I installed the module using pip3.
Anyone know how to solve?
When I check if the module has been installed, I get the following:
Requirement already satisfied: flightradar24 in /usr/local/lib/python3.9/site-packages (0.3.1)
Does it have to do with the fact that it is installed in python3.9? How would I get it installed to python 3.7 specifically using pip?

No module named 'bcolors' although 'Requirement already satisfied'

I am trying to use bcolors in my python code in Spyder/Anaconda but it keeps telling me
ModuleNotFoundError: No module named 'bcolors'.
So I installed it with pip install bcolorswhich gave me Requirement already satisfied: bcolors in e:\anaconda3\lib\site-packages (1.0.4), but it still doesn't work.
What am I doing wrong?
You had that error because you are in different interpreter trying to import the module. You should append the path of the module to your working directory.
import sys
sys.path.append("\anaconda3\lib\site-packages")
import bcolors
Try to install lower version of this module
pip install bcolors==1.0.2
Have you tried installing the pandas' library using pip install pandas
I was having trouble with the latest distribution as well. Installing 1.0.2 worked for me.

Issues with importing win32gui python 3.9

I'm trying to use win32gui from pywin32 but I keep getting this error:
ModuleNotFoundError: No module named 'win32gui'
I am on windows 10, python 3.9
I have been researching the top results on stack over flow and google for a while now and the solutions i found don't work for me.
things I have tried:
installed pywin32 via a whl file (this shows in site packages along with win32 ect)
double checked both 64bit versions of python and pywin32 are installed
Added pywin32 to Path (worth a try)
tried "from win32 import win32gui"
Any help would be appreciated!
Requested commands with output:
importing win32api and win32com results in the same out of
ModuleNotFoundError: No module named 'win32api'
ModuleNotFoundError: No module named 'win32com'
python -m pip install pywin32
Requirement already satisfied: pywin32 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (304.0)
python -c "import win32gui" -- nothing happens when i run this line in a cmd (maybe i have done something wrong here?)
Solution unknown however it was fixed by simply recreating the virtual environment and installing the pywin32.

Error message running python code in VS code: No module named "openpyxl"

So I am using VS code on Mac. I'd like to read .xls file on python. I have installed openpyxl package using code: python3 -m pip install openpyxl. But when I try to run import openpyxl, I get an error: ImportError: No module named openpyxl. When I tried to install the package once more, I got a message: Requirement already satisfied: openpyxl in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages.
So I don't know, why the package can't be imported. Can anyone help me out?

keep getting python ModuleNotFoundError: No module named

I am working on a raspberry pi python project and every time I import a package I get the same error ModuleNotFoundError: No module named ''. for example I am trying to add the ambient_api package
I followed the steps in their set up:
pip install ambient_api
Added the imports at the top of my file:
from ambient_api.ambientapi import AmbientAPI
api = AmbientAPI()
but I am getting the error:
ModuleNotFoundError: No module named 'ambient_api'
This is happening with all the imports I am trying to add and I cant figure out what I am missing.
when I was looking on google I came across __init__.py might be a solution but I am not sure how this works?
edit:
here is what was output when I installed:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: ambient_api in /home/pi/.local/lib/python2.7/site-packages (1.5.2)
Requirement already satisfied: requests in /usr/lib/python2.7/dist-packages (from ambient_api) (2.21.0)
Requirement already satisfied: urllib3 in /usr/lib/python2.7/dist-packages (from ambient_api) (1.24.1)
version in my terminal:
pi#raspberrypi:~/Raspberry-Pi-Greenhouse $ python --version
Python 2.7.16
but it looks like the version in the shell in the ide when I run the program is saying:
Python 3.7.3 (/usr/bin/python3)
As explained by #JaFizz in Pytorch is installed but do not working ubuntu 18.04 it solved by giving an alias and installing correctly to desired python version (there were two pythons installed on the same machine)
First it was necessary to specify the location of the python, example:
alias python=/usr/local/bin/python3.6
Then install it:
python pip install <package name>

Categories

Resources