Reply To: Installing Glade on Linux

Home Forums Installation Installing Glade on Linux Reply To: Installing Glade on Linux

#1047
Ewald
Participant

Hello,

Glade 4.1.69 still issues on my openSUSE 11.2 the error message

import site' failed; use -v for traceback

Root cause is that Glade's Python module 'sys' is defining different attributes than openSUSE 11.2's Python:

Glade 4.1.69 (RH4, 64bit):

p, li { white-space: pre-wrap; }

# Glade release version 4.1.69 compiled on Oct 14 2011 11:28:54
# Qt version 4.7.3 on 64 bit platform (little endian)
# Compiled with gcc version 3.4
# Username: ewald Hostname: abc/def
# Current time: Sun Oct 16 17:52:26 2011
# Operating system: Linux abc/def 2.6.34.10-0.2-default #1 SMP 2011-07-20 18:48:56 +0200 x86_64 x86_64 x86_64 GNU/Linux
# Number of CPUs: 2
# OpenGL vendor: NVIDIA Corporation
# OpenGL renderer: GeForce 8400M GS/PCI/SSE2
# OpenGL version: 3.3.0 NVIDIA 275.21
# OpenGL FBOs will be used.
# Python version 2.6.7 (r267:88850, Jun 27 2011, 05:04:01)
[GCC 4.0.2 20051125 (Red Hat 4.0.2-8)] for linux2
>>> import sys
>>> dir(sys)
['__displayhook__', '__doc__', '__excepthook__', '__name__', '__package__', '__stderr__', '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames', '_getframe', 'api_version', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dont_write_bytecode', 'exc_clear', 'exc_info', 'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info', 'getcheckinterval', 'getdefaultencoding', 'getdlopenflags', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof', 'gettrace', 'hexversion', 'maxint', 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'py3kwarning', 'setcheckinterval', 'setdefaultencoding', 'setdlopenflags', 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', 'subversion', 'version', 'version_info', 'warnoptions']

>>>

p, li { white-space: pre-wrap;

>>> sys.lib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'lib'
>>>

p, li { white-space: pre-wrap;>>> sys.lib

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'lib'
>>>

openSUSE 11.2:
Python 2.6.5 (r265:79063, May 6 2011, 17:25:59)
[GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> dir(sys)
['__displayhook__', '__doc__', '__egginsert', '__excepthook__', '__name__', '__package__', '__plen', '__stderr__', '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames', '_getframe', 'api_version', 'arch', 'argv', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dont_write_bytecode', 'exc_clear', 'exc_info', 'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'exitfunc', 'flags', 'float_info', 'getcheckinterval', 'getdefaultencoding', 'getdlopenflags', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof', 'gettrace', 'hexversion', 'lib', 'maxint', 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'ps1', 'ps2', 'py3kwarning', 'setcheckinterval', 'setdlopenflags', 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', 'subversion', 'version', 'version_info', 'warnoptions']
>>>
>>> sys.lib
'lib64'
>>> sys.arch
'x86_64'
>>>

The openSUSE Python is having the additional attributes 'arch' and 'lib',which Glade's Python (RH4) doesn't have.
Obviously, the sys module is differing for the Linux distributions, see also:
http://old.nabble.com/Looking-for-portable-what-to-determine-directory-where-extensions-are-installed–td26238412.html

Is there a way to add these missing attributes to Glade's Python?
This would allow to work with python inside Glade.
Best regards,
Ewald