I have successfully managed to build and install PySide2 on Python 3.6.4. (default, not Anaconda) on Windows 10 operating system.
However shiboken2 has not been installed. How may I install shiboken2? I know that that the code for this module is attached to PySide2 installation files.
I suspect that my C++ code which is built as DLL file cannot be imported in Python due to missing shiboken2. However this importing works fine in Anaconda environment. But at the moment I do not want to use Anaconda because there are old versions of 'Qt' (5.6 but I need 5.9.x) and 'PySide2' installed.
Just a moment ago I figured it out that shiboken2 can be imported like this:
from PySide2 import shiboken2
So before importing my own files the above line has to be added.
Related
I have downloaded Anaconda 64 bit with Python 2.7 on my compter which works with Windows.
I also downloaded PyQt4 version 4.11.4.
However, when I run my code, I have this :
RuntimeError: the sip module implements API v9.0 to v9.2 but the PyQt4.QtGui module requires API v11.3
I tried to update the sip module, but I can't go further than version 4.18 due (I think) to the version of Python I use. However, I really need to use Python 2.7 since the code that I'm trying to run is old and written in Python 2.
I found out that PyQt4 version 4.9.6 requires a API version 9.1, so it would be supported by the sip module I have.
My problem is that only found that version of PyQt4 in zip file or in tag.gz file and I only know how to install .whl file (with the "pip install" in the anaconda prompt).
I was wondering if someone could please explain me how to install a zip or tag.gz file or if there is a web site that I could use to transform the zip (or tag.gz file) into a .whl file.
Trying to get the samplebinding example working, but no matter the compiler, python or pyside version used, I still get
ImportError: DLL load failed while importing Universe: The specified module could not be found.
Last configuration used:
VS2019
cmake 3.16.2
python 3.81 amd64 from python.org
pyside2, shiboken2 5.14.1 from pip
shiboken-generator whl 5.14.1 from here
Library is compiling fine:
Python 3.8 changed the dll path resolution.
Adding the shiboken2.abi3.dll to the folder resolved the issue.
Modify the import to be Python3 compatible:
from build.Universe import Icecream, Truck
The import of __future__.print_function suggests the file is still written for Python2.
I am running RedHat 4.1.2 offline and trying to get _tkinter working for Python 2.7.13. I have Tcl/tk 8.4 installed, but it doesn't seem to be working right. libtcl8.4.so is located in /usr/lib64/ and I'm not sure if that's related, but I figured I would mention it. Here is the error when I try import Tkinter.
Python terminal output
Perhaps you could try a package manager such as Anaconda and install Tkinter.
This post may help.
So I'm trying to get a program that uses PyQt4 to work in PyCharm on my Mac, but whenever it tries to run, it says
INFO: Could not import backend "PyQt4":
No module named PyQt4
Trying to import PyQt4 using PyCharm's Package Manager generates this error:
Executed Command:
pip install PyQt4
Error Occurred:
0:428: execution error: The directory '/Users/pkillam/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Proposed Solution:
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at '/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7'.
This only happens to certain packages which pip doesn't like, particularly those which use configure.py instead of setup.py as explained here.
Attempting to run the command from the console generates this error:
$ pip install PyQt4
Collecting PyQt4
Could not find a version that satisfies the requirement PyQt4 (from versions: )
No matching distribution found for PyQt4
$
Now, installing the package using homebrew claims to be successful, but I still get the initial error that PyQt could not be imported after homebrew installs it.. somewhere.
I've been running around in circles with this for the past day, any ideas?
You can try to install PyQt4 by downloading it from the official Website. Remember to download PyQt version same as your python version. If you have python 2.7 32bit then download PyQt4 32bit even if your computer is 64 bit.
Similarly, if you have Python 3.x 64bit then you need to download PyQt4 64bit.
You can check your Python version from the default Python 'IDLE'. It should be similar to this.
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
You could try PyQtX. It's not perfectly up-to-date, but maybe a quick solutions in your case.
In Python 3.4 from Anaconda, I created a program and it is giving me and import error each time I run it.
Using Spyder.
ImportError: No module named 'win32api'
I already have the pywin32 installed. And I can see the win32api.pyd under C:\Anaconda3\Lib\site-packages\win32
This is the import code on my program:
from tkinter import *
from tkinter import ttk
import tkinter.messagebox
import time
import requests #needs to be installed
import pymysql #needs to be installed
import csv
import win32com.client #needs to be installed
import datetime
This is the whole error:
File "C:\Anaconda3\lib\site-packages\win32com\__init__.py", line 5, in <module>
import win32api, sys, os
ImportError: No module named 'win32api'
This is the only instance of Python I have installed. I uninstalled everything else and installed only Anaconda.
Searching online I got to something that said that it could be a problem with the PYTHONPATH. But honestly, I have no idea what they are talking about.
So any noob help would be really appreciated.
I am using Windows 7 by the way.
Thank you
The installation for pywin32 must have failed, or it is not for same OS bit architecture (say anaconda 64 bit and pywin32 32 bit). I recommend
you uninstall pywin32,
check what bit version of anaconda you are using, then
install pywin32 for same version,
verify that the installer indicates 100% success and there are no errors flagged in the installer's log window (it's rare but something may fail and the installer doesn't know).
Then open a python console and type "import win32com".
If #5 fails to import win32com, then:
try installing a different version of python, for example from python.org
repeat steps 2 to 5 above but for new python instead of anaconda
Could be that anaconda distributors did something to the python interpreter (although I didn't think so), or that some libs aren't registered right (see answer https://stackoverflow.com/a/17061853/869951 for some more things to try).
This should work:
pip install pypiwin32
I had the same problem and solved it installing the module pywin32:
In a normal python:
pip install pywin32
In anaconda:
conda install pywin32
My python installation (IntelĀ® Distribution for Python) had some kind of dependency problem and was giving this error. After installing this module I never more saw it.
As mentioned by outforawhile in comment, simply restarting the laptop fixed this for me.
It may be that this is required for Windows to register the DLL.
try this before install pywin32
pip install pywinutils