pyqt5 cannot install with python 3.5 - python

I installed python 3.5 then install pyqt5.5.1, when installing the binary file under win7, it showed warning that it's built under python3.4.I installed to the python35 directory anyway.I can open Assistant in start menu.But in python it's not working:
from PyQt5.QtCore import * Traceback (most recent call last): File "", line 1, in
from PyQt5.QtCore import * ImportError: DLL load failed

Use pip to install the Windows wheel file
The installer were based on 3.4. So you can't use it.
Download LINK
Command line guide: pip install name_of_file.whl
PS: install SIP in the same way.

Related

Unable to launch Spyder after installation of PyQt5

On installation of PyQt5 i'm unable to launch Spyder on Windows. When i tried to launch through the conda prompt, i get the following error,
File "C:\Users\sarshetty\Anaconda3\lib\site-packages\qtpy\__init__.py", line 132, in <module>
from PyQt5.QtCore import PYQT_VERSION_STR as PYQT_VERSION # analysis:ignore
RuntimeError: the sip module implements API v12.0 to v12.7 but the PyQt5.QtCore module requires API v12.8
I see the following for my sip and PyQt in the python terminal.
>>> import sip
>>> sip.SIP_VERSION_STR
'4.19.8'
>>> import PyQt5
>>> import PyQt5.Qt
>>> import PyQt5.QtCore
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: the sip module implements API v12.0 to v12.7 but the PyQt5.QtCore module requires API v12.8
I tried upgrading my sip, however that has not helped. Can anyone tell me what is happening and how i can resolve this.
I'm only guessing here but I think the error is referring to PyQt5-sip since the newest release is version 12.8.0
https://pypi.org/project/PyQt5-sip/
(Spyder maintainer here) Anaconda comes with its own version of PyQt5, so you don't need to install it by running pip install pyqt5 (which seems you did).
By doing that, you basically broke Anaconda and now you have to remove and reinstall it, sorry.
This fixed the issue for me
Uninstall the installed PyQt5 library with pip
pip3 uninstall pyqt5
Install PyQt5 with conda
conda install -c anaconda pyqt
Uninstall pyqt5(pip uninstall pyqt5) and then reinstall it version 5.11.3(pip install pyqt5==5.11.3)
After installing the new version it'll show an error msg but it will work anyways.
This has worked for me and my colleges.

Spyder does not open from anaconda

Recently, I had to reinstall anaconda on a new computer.
I downloaded the latest version from anaconda's website, and installed it just as I did before.
Now, when I open anaconda interface and try to run Spyder.exe, I get this message:
Traceback (most recent call last):
File "C:\Users\aabramzonx0108132\AppData\Local\Continuum\anaconda3\lib\site-packages\qtpy\QtWebEngineWidgets.py", line 22, in
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ImportError: DLL load failed: The specified procedure could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\aabramzonx0108132\AppData\Local\Continuum\anaconda3\Scripts\spyder-script.py", line
10, in
sys.exit(main())
File "C:\Users\aabramzonx0108132\AppData\Local\Continuum\anaconda3\lib\site-
packages\spyder\app\start.py", line 186, in main
from spyder.app import mainwindow
File "C:\Users\aabramzonx0108132\AppData\Local\Continuum\anaconda3\lib\site-
packages\spyder\app\mainwindow.py", line 90, in
from qtpy import QtWebEngineWidgets # analysis:ignore
File "C:\Users\aabramzonx0108132\AppData\Local\Continuum\anaconda3\lib\site-
packages\qtpy\QtWebEngineWidgets.py", line 26, in
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'
Could it be that I installed something wrong?
This has to do with PyQt5 module. To fix this issue try removing PyQt5
pip uninstall PyQt5
If that does not work try to reinstall it using
conda install -f qt=5 pyqt=5
Similar post here: 54869374
Anaconda 2020.07, Linux, x84_64
I do not know why, but installing
pip install pyqtwebengine
fixed spyder, which was part of the Anaconda installation.
Details:
This was tested on a fresh fedora-33 virtual machine with Anaconda version Anaconda3-2020.07-Linux-x86_64. pyqtwebengine was not installed before. Trying to uninstall it, gave a WARNING: Skipping pyqtwebengine as it is not installed.

Cannot import zmq in python using pycharm

I am trying to use the zmq Python library but it is not recognized and I have already installed it by using the following command:
pip3 install pyzmq
I am using PyCharm IDE.
The run output gives me this error:
Traceback (most recent call last):
File "C:/Users/Operações/Desktop/Testes/teste.py", line 2, in <module>
import zmq
ModuleNotFoundError: No module named 'zmq'
Does anyone can help me with this?
Instead of using pip, try installing pyzmq from File/Settings in PyCharm.
Open the Settings/Preferences
Navigate to Project: -> Python Interpreter
Klick the + at the bottom of the list
Search for your package of choice and hit Install Package
For more details on installing/uninstalling packages in PyCharm:
https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html

PyQt5.QtWidgets module not found when pyqt is installed with Anaconda

I can import PyQt5 but I cannot import from PyQt5.QtWidgets when I install pyqt in a conda environment.
I've tried uninstalling and reinstalling with conda and that did not solve the problem.
If I install with pip in a regular virtual environment instead of with Anaconda then it works.
This is the code:
from PyQt5.QtWidgets import *
This is the error:
$ python main.py
Traceback (most recent call last):
File "main.py", line 1, in <module>
from PyQt5.QtWidgets import *
ModuleNotFoundError: No module named 'PyQt5.QtWidgets'
Turns out it was a path problem. I had installed Homebrew after Anaconda and /usr/local/bin was in front of $HOME/anaconda3/bin in $PATH, so Homebrew Python was being called instead of Anaconda Python.

PyAudio (PortAudio issue) Python

I installed pyaudio with anaconda python. Using conda install pyaudio on windows.
It said it installed and it also installed PortAudio with it.
However, when I create my file and run it now I get the following issue.
I have no idea what is going on.
Could not import the PyAudio C module '_portaudio'.
Traceback (most recent call last):
File "C:\Users\This PC\Desktop\Py\demo.py", line 2, in <module>
import pyaudio
File "C:\Users\This PC\Anaconda3\lib\site-packages\pyaudio.py", line 116, in <module>
import _portaudio as pa
ImportError: DLL load failed: The specified module could not be found.
I ran into this error with win32 py3 using Anaconda3. Re-installing portaudio fixed this:
conda install portaudio
It just updated the package for me, and pyaudio was able to find the DLL then.
I faced a similar issue.
The only way I was able to resolve this was by uninstalling anaconda, installing the latest version of python, and reinstalling the latest version of conda.
I then downloaded the latest .whl file for pyaudio which can be found here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
I moved this file from my downloads and into the site-packages folder of anaconda3:
C:\Users\Projects\Anaconda3\Lib\site-packages
Upon running the command 'pip install pyaudio' OR 'python -m pip install pyaudio' in the anaconda prompt I was good to go
I hope this helps!

Categories