Steps on howto install PySide on windows - python

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.

Related

ModuleNotFoundError, even after pip install

I have recently bought a new laptop and was viewing some python projects of mine which I made on my pc. For one of them I use the python-bitvavo-api library which I installed using pip3 install python-bitvavo-api. The version I installed is 1.2.2 which is the latest on their website.
Now when I try to import it using this code: from python_bitvavo_api.bitvavo import Bitvavo, I get the following error:
Traceback (most recent call last):
File "C:\Users\indig\OneDrive\Documenten\Python Projects\Personal\Cryptone\Cryptone.py", line 6, in <module>
from python_bitvavo_api.bitvavo import Bitvavo
ModuleNotFoundError: No module named 'python_bitvavo_api'
I read online that it may occur when using multiple python versions, Im only using 1 and thats python 3.7
Btw. I have the same error with the Pillow module, so it might be a setting in visual studio that I dont know of. Anyway, someone please help. If you need more details please ask.
How are you running it? From the terminal or from VS?
You can also check the installed libraries running the command pip list

Installing PySide2 for Python 3.8, Windows

I would like to install PySide2 on my Windows 10, Python version 3.8, despite the wheels not being released for it yet.
Naturally, I have first tried the pip install --python-version 3.7 command to see if simply getting everything, but for the previous Python version, would be fine. It didn't work.
So instead I installed QT on my machine as well as every required dependency and tool to build it manually. I have progressed quite far and managed to successfully build shiboken2, but failed to build PySide2 itself.
The errors I keep getting are about missing DLL-s when trying to import shiboken2. Unfortunately, the output is rather unhelpful as it doesn't actually tell me which ones are missing, and I couldn't figure that out on my own.
The error from the manual building is as follows (nmake command in C:\PySide2\pyside-setup\pyside3_build\py3.8-qt5.12.6-32bit-release\pyside2 directory):
Scanning dependencies of target QtCore_pyi
Traceback (most recent call last):
File "C:/PySide2/pyside-setup/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py", line 294, in <module>
generate_all_pyi(outpath, options=options)
File "C:/PySide2/pyside-setup/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py", line 251, in generate_all_pyi
import PySide2
File "C:\PySide2\pyside-setup\pyside3_build\py3.8-qt5.12.6-32bit-release\pyside2\PySide2\__init__.py", line 51, in <module>
_setupQtDirectories()
File "C:\PySide2\pyside-setup\pyside3_build\py3.8-qt5.12.6-32bit-release\pyside2\PySide2\__init__.py", line 21, in _setupQtDirectories
import shiboken2
ImportError: DLL load failed while importing shiboken2: The specified module could not be found.
I would normally wait patiently until the wheels are released, but I can't find any information on the progress for Windows, and I know the library is available for Python3.8 on other platforms.
Do you recommend any steps to find out what's wrong with my build (I would normally use pip install for PySide2 so this is all new to me), or know how to solve the problem directly? I know shiboken2.cp38-win32.pyd is there and I've also included it in my PATH env var just in case, same for shiboken2.cp38-win32.dll - but these don't seem to be the missing files.
Note: Should this be a Super User question (?)
On Windows platform simple pip install PySide2 is not enough, you should make post-install steps. As part of PySide2 installation you got pywin32_postinstall.py script (Not sure about Win10, but on Windows 7 the path is C:\Users\<your_user>\AppData\Local\Programs\Python\Python38\Scripts\)
You should run pywin32_postinstall.py -install to register DLLs.

Make OpenCV build with Python 3 support

I want to have Python 3 support in OpenCV, so I read that I need to build my own version with it.
I downloaded OpenCV 3 beta from SourceForge, then I used CMake to create a project, and then compiled it with Visual Studio.
It has created lot's of files (not actually the same structure as in precompiled folder from Sourceforge), and also a cv2.pyd. I placed this file into Python34\lib\site-packages, and tried import cv2 in python console, but it says
Traceback (most recent call last):
File "", line 1, in
ImportError: DLL load failed: Module not found.
What I did wrong?
Thanks.
If you want to avoid building your own version, Christoph Gohlke maintains Windows binaries for many Python packages, including the production version of OpenCV 3.0 with Python 3.x bindings, released 4 June 2015:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
To install, just download the 64-bit or 32-bit .whl file appropriate for your system, then run pip install [filename]. Then the instruction import cv2 should work in your Python 3.x interpreter.

Python PyAudio installation problems (with PortAudio)

I'm trying to write a program to record information from my computers microphone an save it to a file. PyAudio seems like one of the better packages for doing this, and they even have a binary for Windows 7 (Python 2.7). I downloaded the executable file and ran it to set up PyAudio, but when I try to import PyAudio into a python script now I get an error:
Please build and install the PortAudio Python bindings first.
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pyaudio
File "C:\Python27\lib\site-packages\pyaudio.py", line 103, in <module>
sys.exit(-1)
SystemExit: -1
If I look at pyaudio.py, the code that it's failing on is:
# attempt to import PortAudio
try:
import _portaudio as pa
except ImportError:
print "Please build and install the PortAudio Python " +\
"bindings first."
sys.exit(-1)
Also, in case it's relevant, if I go to Python27\Lib\site-packages (where pyaudio.py is) there is a file called portaudio_x64.dll.
The documentation on their site only seems to have instructions for if you want to install PyAudio by building from source code. Additionally, it says that PortAudio v19 is included in the binary, so I assumed it would just work after running the setup executable.
I have no idea what's going wrong and I really need this running soon. Any ideas on what's going wrong? Or if anyone has recommendations for similar packages that work better specifically with Windows 7 (64-bit) and Python 2.7 (Enthought distribution), as well as cross-platform, I'd love to hear them.
Copying the answer from the comments in order to remove this question from the "Unanswered" filter:
Try the binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
~ answer per cgohlke

Modules in Python on Windows

I have a simple sode snippet that uses cairomodule. I would like to launch the scipt but it somehow cannot run giving this error :
Traceback (most recent call last):
File "C:\Users\xxx\Desktop\test.py", line 1, in <module>
import cairo
ImportError: No module named cairo
how should I "install" a module in Python on Windows ? I have tried installing http://gladewin32.sourceforge.net/ as stated on cairo page that I can get cairo as a "side effect" of intalling GTK+ but somehow this didn't work.
If I should add some paths to PATH please indicate which one as I am raelly confused about this.
Now I realise how simpler that would be on linux with powerful terminal :)
Try installing PyGtk from here: http://www.pygtk.org/downloads.html. The all-in-one-installer worked for me. Just choose the packages you want installed.

Categories

Resources