PyQt5 DLL load failed - python

First off, i know this has been asked quit often like here and in many other posts1 2 3 4 . I read all of the posts on this and other forums but none did resolve my issue or i did not understand where excatly i need to copy some missing dlls? I hope to find some guidance .
I recently installed python on win10 via the microsoft store. The version is Python 3.7.4.
When i type "where python" i get the following result:
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1264.0_x64__qbz5n2kfra8p0\python.exe
C:\Users\xxx\AppData\Local\Microsoft\WindowsApps\python.exe
The packages are installed via pip to:
C:\Users\xxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37
When i try to import PyQt5 (which installed via pip without any error) i get the following result:
>>> from PyQt5.QtWidgets import QApplication
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.
I do see the PyQt5 packes in the "site-packages" folder.
I read somewhere that qt5 is not compatible at all with python in its current version. Is this correct? If so what would you advise me to use instead? At the moment i just want to create a small gui for a matplotlib bases plotting tool that needs to additional options like fileinpout and a few clickable buttons to choose options.
Thank you in advance.

Related

Opencv not working for python?

When ever I say import cv2 and run in IDLE it gives me an error saying:
Traceback (most recent call last): File
"/Users/Victor/Documents/Python Related/Python Code for
Class/blah.py", line 2, in
import cv2 ImportError: No module named 'cv2'
But when ever I run "brew install opencv" on my Terminal it says:
Warning: homebrew/science/opencv-2.4.13.2 already installed, it's just
not linked.
Which I am taking it as Opencv is already installed. I have no idea why it wont work when I run it in python. I have followed this link and
I also used this link.
but that did not seem to help much. I have spent all day on trying to make this work ...
Wanted to see if anyone who has experience with OpenCV can give me a bit of guidance. It is definitely not as simple as installing pygame or other models.
Try export PYTHONPATH=/usr/local/lib/python{version}/site-packages:$PYTHONPATH

I need Anaconda 32bit and 64bit

I currently develop in Pycharm v4 and use Anaconda 64bit. I now need to begin using http://www.zipline.io/ which only supports Anaconda 32bit. Is there a way to have both the 32 and 64 bit versions installed and just tell Pycharm which one to use for a specific project?
Pycharm supports the creation of virtualenv environments from within the IDE, perhaps something can be done in that way? I've never used virtual environments before. Or would it be possible to just install Anaconda 32bit into it's own folder, then tell Pycharm which to use for each project.
Any advice is appreciated.
I have installed Anaconda 32 bit in a separate folder and selected this version from within Pycharm settings for the interpreter. When trying to run a basic zipline project I get the following error:
"C:\...\Anaconda3 - 32bit\python.exe" "E:/Python Projects/ZiplineTesting/Main.py"
Traceback (most recent call last):
DLL load failed: %1 is not a valid Win32 application.
File "E:/Python Projects/ZiplineTesting/Main.py", line 1, in <module>
from zipline.api import order, record, symbol
File "C:\...\AppData\Roaming\Python\Python34\site-packages\zipline\__init__.py", line 25, in <module>
from . import data
File "C:\...\AppData\Roaming\Python\Python34\site-packages\zipline\data\__init__.py", line 1, in <module>
from . import loader
File "C:\...\AppData\Roaming\Python\Python34\site-packages\zipline\data\loader.py", line 25, in <module>
import pandas as pd
File "C:\...\AppData\Roaming\Python\Python34\site-packages\pandas\__init__.py", line 7, in <module>
from . import hashtable, tslib, lib
ImportError: DLL load failed: %1 is not a valid Win32 application.
Process finished with exit code 1
It's worth noting that in my code, Pycharm has highlighted my import statement as having an error (with 'order' as well as 'record'). However there is nothing wrong with the import:
from zipline.api import order, record, symbol
The error is:
Unresolved reference 'order'
This inspection detects names that should resolve but dont.
Due to dynamic dispatch and duck typing, this is possible in a limited
but useful number of cases, Top-level and class-level items are supported
better than instance items.
Any ideas on what I might be doing incorrectly? I have tried uninstalling and reinstalling zipline which hasn't helped. It seems like there is some sort of conflict with my prior 64bit stuff with the new 32bit stuff.
In the "Settings" menu of PyCharm look for the "Project: [project name]" section. You can select the Python interpreter used for the project from there.
As long as the 32-bit version of Anaconda is installed to a separate location from the 64-bit version, there should be no problem.

Cannot compile a PyQT designer file into a Python

I hope someone can help me as I've already spent several hours trying to sort this issue out without success. I am trying to use compileUi from the modPyQt4.uic to compile a PyQT Designer ui file into a Python py file, but when I do I get errors saying the DLLs fail to load.
Investigating further I found that these errors occur because Python cannot find Core QT module. I get the following error when trying to import the Core Qt module into Maya 2011:
from PyQt4.QtCore import *
# Error: line 1: DLL load failed: The specified procedure could not be found.
# Traceback (most recent call last):
# File "<maya console>", line 2, in <module>
# ImportError: DLL load failed: The specified procedure could not be found. #
I have seen that others have had similar issues and that the advice given in response is to to either move the DLLs /bin directory under PyQT4 into the root directory of the installation or alter the environment variable so that it points to the /bin directory ahead of all other directorys in the Python installation.
In my situation, however, the /bin directory doesn't even exist in my installation and even after reinstalling it it still is not there. Why is it not there? Have the developers moved the files elsewhere?
My installation is as follows:
Windows 7
Python 2.6.4 running in Maya 2011
PyQT v4.8.4 for Python 2.6
Once again I hope someone can help me as I want to lean PyQt, but if I can't solve this problem it is going to be an impassable barrier to progressing further.
Thanks in advance,
Terry Rozmus
Instead of writing " from PyQt4.QtCore import * "...use from PyQt4 import QtGui, QtCore..

Error Importing GTK

I'm running Python 2.7, with the latest version of GTK installed.
I'm trying to import gtk with the following line of code:
import gtk
It is throwing the following error:
Traceback (most recent call last): File
"C:\GTKTutorial\tutorial.py", line 3, in
import gtk File
"C:\Python27\lib\site-packages\gtk-2.0\gtk__init__.py", line 40, in
from gtk import _gtk ImportError: DLL load failed: The specified
procedure could not be found.
How do I fix this? import pygtk is working, and I have Glade 3.8.0 installed.
Where did you get the PyGTK installer from? Try using this one: http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/pygtk-all-in-one-2.22.6.win32-py2.7.msi
I just spent 3 days debugging this issue on my computer. This problem can have many root causes because importing gtk actually causes a lot of DLLs being loaded. If any of them fails, you get the same error message. For me, the break-through was
http://www.dependencywalker.com/
which I used to profile the command
python -i -c "import gtk"
On my PC, a wrong version of zlib1.dll was in the system32 directory, which prevented the right one in gtk\bin from loading. And it did that even though the first entry in my path pointed to gtk\bin.
I deleted the zlib1.dll from system32 (the application that put it there deserves to die) and the import worked fine. Your problem may be different, but dependency walker probably can give you a hint on what is going wrong.
Windows can have other reasons for loading a DLL other than the one you put in your directory or path. I found the blog
http://www.davidlenihan.com/2007/07/winsxs.html
useful. It describes Microsoft's solution for managing many versions of DLLs, and how to troubleshoot problems with it.

Steps on howto install PySide on windows

I followed what they said at pyside.org but somehow i can't get it to work.
I downloaded the two files that they are linking from their site (qt libraries and pyside for python 2.6)
When I try one of their examples I get the following message:
Traceback (most recent call last):
File "2dpainting.py", line 28, in <module>
from PySide.QtCore import *
ImportError: DLL load failed: The specified module could not be found.
I use python 2.6.4 and windows 7
You need to add the QT bin directory ("C:\Qt\4.6.3\bin") to your path environment variable.
The situation with Windows binaries significantly improved in 1.0.0 release. Try newer installers from downloads page.
There is a similar question on Installing PySide - Windows 8
You can simple use
pip install PySide
to install it.

Categories

Resources