Python qt4-designer - pyuic4 - No module named DLFCN [Solution Found]
#1
Posted 15 February 2012 - 03:10 AM
I've installed qt4-designer qt4-doc-html pyqt4-dev-tools with apt-get.
When I try to run pyuic4 I get:
tal:~/prog/sc$ pyuic4 -d form-main.ui
< snipped>
File "/usr/lib/pymodules/python2.6/PyKDE4/__init__.py", line 1, in <module>
import sys,DLFCN
ImportError: No module named DLFCN
From the python prompt, import DLFCN or sys.DLFCN reports No module named DLFCN
This may?? be related to:
http://bugs.python.org/issue12571
http://bugs.python.org/issue12326
Any ideas would be appreciated.
Thanks
Python 2.6.6 (r266:84292, Jan 3 2012, 04:14:00)
pyuic4 --version : Python User Interface Compiler 4.7.2 for Qt version 4.6.2
Linux f9 3.2.0-11-generic-pae
#2
Posted 15 February 2012 - 03:39 PM
It does seem this is probably related to the links you give. Spending too much time googling around it seems this module DLFCN should be installed but is not built properly building python using a 3.x kernel. I have limited experience here and this is out of my comfort zone, so I may not know what I am talking about.
A possible work around:
I noticed in the python documentation:
If DLFCN is not available, it can be generated from /usr/include/dlfcn.h using the h2py script.
Sounds very promising until I check my system out and the only h2py.py script I have is on my windows partition (for python 2.7)
I extracted it and then ran
./h2py.py /usr/include/dlfcn.h
and that created the file DLFCN.py which I moved to /usr/share/pyshared
Now at least I can do the import DLFCN in python with no errors.
However: I am not familiar with the qt4-designer stuff nor the pyuic4 command (script ?) So I make no promises that pyuic4 will run correctly after doing this. Please let us know if this works for you.
Note: I consider this a bug with our python2.6 package so I am moving this to Bug Reports as I want to ensure Jeff sees it. Maybe Jeff can fix the python 2.6 package. If Jeff or other mods do not consider this a bug then feel free to move it back to support.
"No technology can ever be too arcane or complicated for the black t-shirt crowd."
#3
Posted 16 February 2012 - 02:32 AM
I followed your instructions and pyuic4 works.The only difference was that I copied module the into /usr/lib/python2.6/plat-linux3/DLFCN.py as it seemed appropriate when compared with other distros (see below).
My Bodhi has had a 3 kernel since birth, I suppose this is why I don't have a plat-linux2 dir in lib/python.
By the way, this is what I've found on some other boxes:
Debian Squeeze - 2.6 kernel - /usr/lib/python2.6/plat-linux2/DLFCN.py
Debian wheezy - 3.0 kernel, was 2.6 at install - /usr/lib/python2.7/plat-linux2/DLFCN.py and /usr/lib/python2.6/plat-linux2/DLFCN.py
Thanks again for your time.
Pat
#4
Posted 16 February 2012 - 02:23 PM
You are a champion, Thanks!
I followed your instructions and pyuic4 works.The only difference was that I copied module the into /usr/lib/python2.6/plat-linux3/DLFCN.py as it seemed appropriate when compared with other distros ...
Fantastic
You are right as to the location, that does seem more standard. I just stuck the module someplace I knew python would find it to make sure it in fact worked and didn't throw any errors on import
"No technology can ever be too arcane or complicated for the black t-shirt crowd."
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












