No module named 'PyQt5.sip' even if I just installed it - python

I am using Ubuntu VM and trying to run a GUI script - this is the entire repo and this is the script. Apparently I didn't need to install PyQt5, because it said Requirement already satisfied: pyqt5 in ./.eggs/PyQt5-5.14.2-py3.8-linux-x86_64.egg (5.14.2)
Requirement already satisfied: PyQt5-sip<13,>=12.7 in ./.eggs/PyQt5_sip-12.7.2-py3.8-linux-x86_64.egg (from pyqt5) (12.7.2).
However, when running the script, I got the error:
Traceback (most recent call last):
File "Scripts/CellModellerGUI.py", line 9, in <module>
from PyQt5.QtWidgets import QApplication
ModuleNotFoundError: No module named 'PyQt5.sip'
So I installed it with pip, but I get the exact same error.
I tried pyqt5-sip, too, but "Requirement already satisfied" appeared again.

It's possible that your pip and python are not linked to the same version. Try doing pip --version and python --version and see if the Python versions match (not the pip version, but the Python version it says it's linked to)

Related

Why cant I use my newly downloaded python library?

So ive tried to install customtkinter and the installation was successfull
Using cached customtkinter-4.6.3-py3-none-any.whl (246 kB)
Requirement already satisfied: darkdetect in c:\users\omen1\appdata\local\programs\python\python311\lib\site-packages (from customtkinter) (0.7.1)
Installing collected packages: customtkinter
Successfully installed customtkinter-4.6.3
But when i then go to vs code and write import customtkinter and run it says
Traceback (most recent call last):
File "c:\Users\OMEN1\OneDrive\Skrivbord\python projects\database.py", line 290, in <module>
import customtkinter
ModuleNotFoundError: No module named 'customtkinter'
I have tried to uninstall and re-install
My pip is also fully uppdated aswell as my python 3.11
Ive tried multiple things
Ensure that the interpreter you're using in VSCode is aligned to where you installed the library.
For example if you installed it with Python3, your VSCode may be pointed to Python2 instead.
Additionally, according to the PyPi link for that library - "To use CustomTkinter, just place the /customtkinter folder from this repository next to your program, and then you can do import customtkinter."

Unable to import psutil in python3 with cygwin [ImportError: no os specific module found]

I've been trying to import the psutil module from cygwin (as a Linux alternative for Windows 7). The installation worked, though.
When re-installed, it showed:
Requirement already satisfied: psutil in /usr/local/lib/python3.8/site-packages (0.1.3)
But when imported, it gave:
>>> import psutil
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/psutil/__init__.py", line 61, in <module>
raise ImportError('no os specific module found')
ImportError: no os specific module found
I tried a couple of things:
Upgrading the pip and psutil itself, using these commands:
python3 -m pip install --upgrade pip
pip3 install --upgrade psutil
so the current version:
Requirement already satisfied: pip in /usr/local/lib/python3.8/site-packages (21.2.4)
Requirement already satisfied: psutil in /usr/local/lib/python3.8/site-packages (0.1.3)
Made sure that packages are installed only in the python 3.8.10 version (I have multiple versions of python installed, so I figured the inconsistency of versions may be causing the problem. But still, it didn't help).
Though, what I've done so far is just making sure I'd type an extra "3" after each python-related command.
I'm still new to cygwin and python, any help would be very much appreciated, thanks!
I may be wrong here, but I did some digging, and it looks like they have been trying add cygwin support for psutil since 2010, see github page for psutil issue #82. Looks like there is no support for now.

pip Installed biopython, but it won't compile Bio Module

I have biopython installed, but it keeps saying no module named Biopython
I had this working previously so I know it works, but I wanted the program to compile on a different computer. I installed python on the computer (version 3.7.3) and installed Pycharm Community Edition as the IDE. After that I installed pip and did the following in the pycharm terminal:
pip install biopython
Output:
Requirement already satisfied: biopython in c:\users\thisi\appdata\local\programs\python\python37\lib\site-packages (1.73)
Requirement already satisfied: numpy in c:\users\thisi\appdata\local\programs\python\python37\lib\site-packages (from biopython) (1.16.4)
Yet, whenever I compile the program, I get the following error.
C:\Users\thisi\AppData\Local\Programs\Python\Python37\python.exe C:/Users/thisi/Desktop/H-protein/py-scripts/protein-blastp.py
Traceback (most recent call last):
File "C:/Users/thisi/Desktop/H-protein/py-scripts/protein-blastp.py", line 1, in <module>
from Bio.Blast.Applications import NcbiblastpCommandline
ModuleNotFoundError: No module named 'Bio'
Process finished with exit code 1
I have browsed the internet for hours to find a solution, but none seem to work as they are tailored to linux.
Other Relevant Details:
My OS is Windows10
If I open the project interpreter, it shows biopython package installed in my current project and python 3.7 as the interpreter. Any help would be appreciated.
from Bio.Blast.Applications import NcbiblastpCommandline
I just need the first line of code to compile
The function I gave is an example of how I use the biopython package

can't run any python script

When trying to run any Python script - Python2 or Python3 and install pip, I get an error:
Traceback (most recent call last):
File "inSp3ctor.py", line 22, in <module>
from colorama import Fore, Back, Style
ImportError: No module named colorama
If I try to sudo pip install colorama it tells me that the requirement is already satisfied:
asdw#sasxa:~/Desktop/inSp3ctor$ sudo pip install colorama
Requirement already satisfied: colorama in /usr/local/lib/python3.6/dist-packages (0.3.9)
I think the problem is occurring due to different versions of python on your machine and you might be making use of python3 , so try performing pip3 install your module name
and re open the idle or ide and run the code

couldnt install python-colorama

I am trying to install Jarvis ai from https://github.com/sukeesh/Jarvis (I know it is not meant to be installed on windows 10. but I try it anyway)
It said no module named colorama, so I typed pip install python-colorama. Then it said
Could not find a version that satisfies the requirement python-colorama (from versions: )
No matching disribution found for python-colorama
I tried to install it using ubuntu, but different problem occurs: it said
Specify python version(2/3)(Default-3)3
Selected python version 3
Running virtualenv with interpreter /usr/bin/python3
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 22, in <module>
import distutils.spawn
ModuleNotFoundError: No module named 'distutils.spawn'
So its like asking 2 question in one. On windows it is
C:\Users\badarsyah\Jarvis>pip install python-colorama
Collecting python-colorama
Could not find a version that satisfies the requirement python-colorama (from versions: )
No matching distribution found for python-colorama
But on ubuntu 18.04
aiki#LAPTOP-886AEJJG:~/Jarvis$ ./setup.sh
Specify python version(2/3)(Default-3)3
Selected python version 3
Running virtualenv with interpreter /usr/bin/python3
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 22, in <module>
import distutils.spawn
ModuleNotFoundError: No module named 'distutils.spawn'
I hope anyone can help, but please read the GitHub first so you can understand what im trying to do.
I managed to solve this problem by simply update pip with
python -m pip install -U pip
then ran again the install command.

Categories