[Last article] I installed PySide2 under Pyenv + Virtualenv environment at (http://qiita.com/Keck/items/60bdbc0869abb89287b0), but pyside2-uic, a tool for converting UI files created by Qt Designer, does not work well. So, make a note of how to deal with it
$ pyside2-uic
Traceback (most recent call last):
(Omission)
File "/home/hoge_user/.pyenv/versions/pyside_test/lib/python3.5/site-packages/PySide2-2.0.0.dev0-py3.5-linux-x86_64.egg/pyside2uic/__init__.py", line 27, in <module>
from pyside2uic.Compiler import indenter, compiler
Note the path to the pyside2uic directory in the error display (the path depends on the Virtualenv name etc.)
$ cd [Noted directory]
$ ll
88 in total
drwxrwxr-x 3 hoge_user hoge_user 4096 april 10 11:37 ./
drwxrwxr-x 5 hoge_user hoge_user 4096 april 10 11:35 ../
-rw-rw-r-- 1 hoge_user hoge_user 5027 april 10 11:37 __init__.py
drwxrwxr-x 2 hoge_user hoge_user 4096 april 10 11:37 __pycache__/
-rw-rw-r-- 1 hoge_user hoge_user 4039 april 10 11:35 driver.py
-rw-rw-r-- 1 hoge_user hoge_user 1101 april 10 11:35 exceptions.py
-rw-rw-r-- 1 hoge_user hoge_user 4533 april 10 11:35 icon_cache.py
-rw-rw-r-- 1 hoge_user hoge_user 3986 april 10 11:35 objcreator.py
-rw-rw-r-- 1 hoge_user hoge_user 16295 April 10 11:35 properties.py
-rw-rw-r-- 1 hoge_user hoge_user 32268 April 10 11:35 uiparser.py
When I look into the directory, I can't actually find the Compiler directory.
So, if you look at the git repository cloned in the previous article ...
$ cd pyside2-setup/pyside_package/pyside2uic/
$ ll
96 in total
drwxr-xr-x 5 hoge_user hoge_user 4096 april 10 11:35 ./
drwxrwxr-x 5 hoge_user hoge_user 4096 april 10 11:35 ../
drwxr-xr-x 2 hoge_user hoge_user 4096 april 10 11:35 Compiler/
-rw-r--r-- 1 hoge_user hoge_user 5000 april 10 11:35 __init__.py
-rw-r--r-- 1 hoge_user hoge_user 4039 april 10 11:07 driver.py
-rw-r--r-- 1 hoge_user hoge_user 1101 april 10 11:07 exceptions.py
-rw-r--r-- 1 hoge_user hoge_user 4533 april 10 11:07 icon_cache.py
-rw-r--r-- 1 hoge_user hoge_user 3986 april 10 11:15 objcreator.py
drwxr-xr-x 2 hoge_user hoge_user 4096 april 10 11:35 port_v3/
-rw-r--r-- 1 hoge_user hoge_user 16295 April 10 11:07 properties.py
-rw-r--r-- 1 hoge_user hoge_user 32268 April 10 11:07 uiparser.py
drwxr-xr-x 2 hoge_user hoge_user 4096 april 10 11:35 widget-plugins/
Find Compiler directory port_v3, widget-plugins directory, etc. Copy all for the time being
$ cp -r port_v3 [Noted directory]
$ cp -r widget-plugins [Noted directory]
$ cp -r Compiler [Noted directory]
$ pyside2-uic
Error: one input ui-file must be specified
Import errors no longer occur Execution with a UI file also worked fine
Recommended Posts