Cannot Use PySide on WIndows - python

I am trying to use the pyside tool on Windows to make a python file out of a .ui
I've installed pyside version 1.2.1-6 from the canopy distribution.
C:\Users\nick\Desktop\pump_project>pyside-uic.exe history_dialog.ui -o kalimera.py
Traceback (most recent call last):
File "c:\users\nick\appdata\local\enthought\canopy\user\scripts\pyside-uic-scr
ipt.py", line 8, in <module>
from PySide.scripts.uic import main
ImportError: No module named scripts.uic

Perhaps an error in your .ui?
pyside-uic apparently works fine for me, at least doesn't fail (using Canopy 1.4.1) compiling this example .ui -- https://qt.gitorious.org/pyside/pyside-examples/source/d4e4c7fdf71ab52083e49ffdea1b7daeff6c8d8d:examples/pyuic/demo.ui

Related

Python3 Modules not loading on other computers

I have been coding an python application in PyCharm and I have had an issue when trying to run to program on other devices. When cloning the repo on my laptop I keep getting this error:
Traceback (most recent call last):
File "/home/matthew/PycharmProjects/HealthTrackerForRachel/Main.py", line 4, in <module>
from PyQt5 import QtWidgets
ModuleNotFoundError: No module named 'PyQt5'
I have done pip install PyQt5 on my current computer so it should have the module. I am also using venv so could this be causing an issue?
I think the problem has to do with installing PyQts5. here the question was answered already ImportError: No module named PytQt5.

Python "import random" generate "ImportError: cannot import name 'MethodType'"

I am using
Visual Studio 2017
Python 3.6 64 bit
When I use the Visual Studio built interactive environment, I am about to "import random" no problems
When I run the code (without the debugger) I get the following error
Traceback (most recent call last):
File "C:\Users\Andy Slater\github\Introduction to Python Fundamentals\Introduction to Python Fundamentals\sorting.py", line 149, in <module>
import random
File "C:\Program Files\Python36\lib\random.py", line 41, in <module>
from types import MethodType as _MethodType, BuiltinMethodType as _BuiltinMethodType
ImportError: cannot import name 'MethodType'
I'm no pro, but I think you're having a dependency problem. Have you messed around in the python directory at all? Random comes with the standard library, and so does types. You can try un-installing and re-installing python, or updating it. You might also try to see if you can just pip install 'types'

Python3 and GTK3 on Windows

I am currently trying to use GTK3 and Python3 for GUI development.
Everything is working fine while doing this on my Ubuntu device, but as I want to be able to have Windows executables later, I need to set these tools up on Windows 7.
I have Python 3.4.4 (64 Bit) installed on my system and tried solutions from other posts on Stackoverflow to be able to use GTK with it, but I was not able to get it to work.
When trying to import Gtk (import gi and from gi.repository import Gtk) on the Python shell, the following error occurs:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 2158, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python34\lib\site-packages\gi\importer.py", line 100, in find_module
'introspection typelib not found' % namespace)
ImportError: cannot import name Gtk, introspection typelib not found
What I have installed at the moment:
PyGi 3.18.2 AIO for Python 3.4 64-bit
GTK3-Runtime Win64 (bin directory created during installation is included into PATH)
Which is the best way to get a working set of Python3 and GTK3 on Windows? (As far as I have seen it is not possible to create Windows executables using Ubuntu.)
You need only to install Python 3.4 and the PyGObject project on sourceforge (the one you mentioned in your post).
This setup must work on Windows, because it works for me.
Maybe you missed to check the Gtk3 libraries during installation of PyGObject (this is a frequent error).
You don't need msys2 at all to use PyGObject in Python.

Installed pyside for python 2.7 from binary but is missing the link to the DLL for qt

I installed the binary pyside from the unofficial binary site and I get the error
>>> import PySide
>>> import PySide.QtCore
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified procedure could not be found.
Now googling the problem it says that there should be an environment variable for QT but there wasn't one created when the binary package was installed. My site packages folder contains the dlls for QT but adding that to the path didnt work either. Any ideas?
I probably have kivy and annaconda (which i dont use) on my system if that is causing conflicts, but i see nothing in my path pointing to that.

Python 2.6.7 not initialing in windows

I am trying to get Python to run to use with Blender. I have 64 bit Vista SP2. 2.6.7 Python. When I start python the command prompt tells me this
'imprt site' failed; use -v for traceback
Traceback <most recent call last>:
File "c:\Python26\Scripts\pypm-script.py", line 5, in <module>
Import Error: No module named pkg_resources
So, I opened pypm-script.py
#!python2.6.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pypm==1.3.4','console_scripts','pypm'
__requires__ = 'pypm==1.3.4'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('pypm==1.3.4', 'console_scripts', 'pypm')()
)
This is very frustrating, because have no idea how to read code or how to use Python! I hope this is easily fixable.
The file pypm-script.py (and pkg_resources) come from ActivePython. You probably must have installed a different Python on top of ActivePython. I can think of two ways to fix this problem:
Uninstall Python, remove C:\Python26 and install ActivePython 2.6 (or 2.7), or
Remove C:\Python26\Scripts\pypm* and C:\Python26\Lib\site-packages\pypm*

Categories

Resources