Answer the question
In order to leave comments, you need to log in
How to import pyqt5 module?
Installed pyqt5 and pyqt5-tools via console. I can run the designer through the console.
But when I create a python file in python charm and try to import the PyQt5 module, it gives an error
No module named 'PyQt5'
there is a pyqt5 folder in lip\site-packages\
also after my unsuccessful attempts, many files in the pyqt folder open in pycharm in pyd format
Ready to provide screenshots if it helps
. Before that, I only worked with standard libraries (I apologize if the question sounds incorrect)
Answer the question
In order to leave comments, you need to log in
1. Perhaps you installed it in a virtual environment, but did not activate it (virtual environment)
2. Check which interpreter is selected in pycharme python3, python2.7, or virtual environment is selected.
3. Check where you put pip freeze, pip3 freeze, or you need to activate the virtual environment and pip freeze there (depending on what and how and on which system you have installed)
Accordingly, you need to install the library for the selected interpreter, or select the interpreter which sees your
PendiPiper
library.
In Linux, for example, python2.7 is already installed, respectively, its package manager is pip .
python -V # проверить версию питона2
sudo apt install python-pip # установить пакетный менеджер
pip install name_package # установка библиотеки для python2
pip freeze # просмотреть установленные библиотеки
python3 -V # проверить версию питона3
sudo apt install python3-pip # установить пакетный менеджер
pip3 install name_package # установка библиотеки для python3
pip3 freeze # просмотреть установленные библиотеки
virtualenv -p python3 my_venv
virtualenv -p python my_venv
source my_venv/bin/activate # в линуксе
source my_venv/Scripts/activate # в виндовсе
pip install name_package # установить библиотеки
pip freeze # просмотреть установленные библиотеки
# только при активированном виртуальном окружении
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question