I can't figure out how to install PyQt5 - python-3.x

I am not a pro, just an amateur enthusiast trying to level up. Apparently I am missing something when it comes to installing PyQt5. In the effort to do so I have gone through several versions of python, and screwed up PyCharm such that it basically doesn't run even my old stuff.
I currently have a 64 bit Python 3.5 and a 32 bit python 3.6 installed. I couldn't figure out where the install file on the latest PyQt5 was, so I used an exe version: PyQt5-5.6-gpl-Py3.5-Qt5.6.0-x32-2.exe
All appeared well, but after this step PyCharm wouldn't work, so I got it to rediscover Python again, but now I get the error:
Traceback (most recent call last):
File "C:/Users/RFC/PycharmProjects/PyQt_learning/test.py", line 2, in <module>
from PyQt5 import QtCore, QtWidgets
ModuleNotFoundError: No module named 'PyQt5'
So, any help would be greatly appreciated!

The first thing I suggest you do is uninstall and redownload the exe. Also after checking the website I have discovered that this version of PyQt5 is only compatible with Python 3.5 not 3.6.

Related

How do I correctly install PyQt5 module against Intel Python 3.6.x (64 bit)?

I am attempting to install the module PyQt5 against my Intel Python 3.6 installation running on a 64 bit Windows 10 OS. PyQt5 5.12 is installed correctly (as far as I can tell) via pip, however I am getting the below error when running my code. I understand that Intel Python 3.6 is a 64 bit application and that the error means that PyQt5 is 32 bit...however I'm not sure what to do about it.
I have the reference Python 3.7 installed and fully working with PyQt5. I have another version of PyQt5 installed elsewhere on my system. Is it possible that my dll files are linked to this other installation?
Traceback (most recent call last):
File
"C:/Users/my_username/PycharmProjects/iAnalysis/venv/gui/hypergeometric_calculator.py", line 16, in <module>
from PyQt5.QtCore import Qt
ImportError: DLL load failed: %1 is not a valid Win32 application.
It appears that as of June 2019 Intel Python is not compatible with PyQt5 and therefore there is no answer to this question at the moment.

PyQt4 installation on Linux

Please help to finish installation of PyQt.
So I think I successfully installed SPI and PyQt as it is mentioned in the reiverbankcomputing. (https://www.riverbankcomputing.com/software/pyqt/download)
(at least no errors where raised during installation).
However when in python shell I import PyQt, python does not recognize it:
>>> from PyQt4 import QtCore, QtGui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4
To my opinion the issues is in PATH variable. I am not root in Linux, so installed python only for my user.
I assume I need to setup some environment variables, but don’t know which ones.
Can you please help?
P.S. My linux is not conntected to Web, so need to download all packages seperatly.

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.

Python 3.3 + pygame installation

First, I am aware about the existance of a similar older thread, but honestly, I would not ask, if I found any help there.
Being a simple coding enthusiast, I want to playback media in using python. Since there seems to be no simple solution, a lot of people recommend pygame (or pyglet). So, using win 7 x64, I revert to 32bit Python 3.3.5 and download the presumably correct version of pygame from the super secret download site (pygame-1.9.2a0.win32-py3.3). Both installations work seemingly fine, pygame can locate python (path is set correctly), and finishes its install without issues, yet it seems not to install anything. I cannot import pygame, there are no installed libraries to be found. In pure frustration I tried different iterations of versions, python 2.7, x64, older pygame versions. Nothing worked. I suspect, there is something going on, that may not be connected to the pygame installation, but I don't know what.
import pygame
returns
Traceback (most recent call last):
File "C:/***/pygame_test.py", line 1, in <module>
import pygame
ImportError: No module named 'pygame'
Try using Python 3.2.3 instead of 3.3, along with Pygame for that version: that's what I did, and it works flawlessly on the same system as yours.
You should check up with your installation. Are you sure you installed properly. I have checked on 3.4/3.6/2.7 all works fine. Just install the correct binaries based on your system from http://www.lfd.uci.edu/~gohlke/pythonlibs/.
Download pygame using pip, to be sure that the module is placed in the correct path. Else, put the pygame folder in .\pythonX\Lib\site-packages\. Verify the folder is named pygame and not for example pygame-1.9.2a0.win32-py3.3.

python3 importing pygame results in PyCObject_AsVoidPtr

I have encountered difficulty putting pygame together with python3 on my MacBookPro.
I installed Python 3.3, and my MacOS is running version 10.7.5.
Then I downloaded pygamev1.9.1 source code, and followed instructions in http://programming.itcarlow.ie/PyGameInstall.pdf
Compilation and installation was smooth until I issued "import pygame" inside python3.
Then I encountered the following "PyCobJect_AsVoidPtr" error (further text following error message):
import pygame
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pygame/init.py", line 95, in
from pygame.base import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pygame/base.so, 2): Symbol not found: _PyCObject_AsVoidPtr
Referenced from: /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pygame/base.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pygame/base.so
A search on google indicates this symbol has been removed since Python3.2:
http://mail.python.org/pipermail/python-dev/2011-March/108882.html
Can someone please give me some advice on how to get pygame working on Python3.3?
More so, whereas I am aware the pygame/python3 developers are busy with their work, but I would certainly appreciate it if someone can provide precompiled pygame binaries for python3. I have limited computer skills, and I just want to go ahead and learn Python3 and pygame, and this is seriously stunting my interest.
I notice that you were trying to compile from source, but builds on Python 3.3, to my knowledge, are not yet supported (as of January 2013). In fact, the only binaries I'm aware of for PyGame and Python 3.3 are unofficial builds and Windows only.
You should consider instead using a previous version of Python (e.g. Python 2.7.*), PyGame builds/binaries on which are well-supported. Any points on setting up should be directed to the pygame-users mailing list, if they weren't already.

Resources