Welcome Guest. Please Login or Register  


You are here: Index > Glade Forum > Installation > Topic : Installing Glade on Linux

2


Threaded Mode | Print  

Installing Glade on Linux
Ewald
Group: Member
Post Group: Newbie
Posts: 14
Status:
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-dir ectory-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




IP: --   

Installing Glade on Linux
Keith
Group: Moderator
Post Group: Super Member
Posts: 868
Status:
I'm not aware of any easy way of doing this - if anyone else is, I'd like to know. I'll ask a friend who is a python guru if he's any ideas.

The only foolproof way I know currently is to install the ActiveState python corresponding to the one Glade is linked to (now 2.6) and set your pythonhome to this.


IP: --   

Installing Glade on Linux
Keith
Group: Moderator
Post Group: Super Member
Posts: 868
Status:
One other point: is this problem only in OpenSUSE 11.2, and not in the later version 11.3 as you say above?

According to http://docs.python.org/release/2.6.7/library/sys.html#module-sys , there is no documented function sys.lib(). Maybe it was removed in the later version to comply with the official documentation?
IP: --   

Installing Glade on Linux
Ewald
Group: Member
Post Group: Newbie
Posts: 14
Status:
As far as I understand, some distributions have multilib support.
Some backgroup on multilib is given at
http://cblfs.cross-lfs.org/index.php/Python
There you can also find a patch for multilib support, e.g.
http://svn.cross-lfs.org/svn/repos/patches/Python/Python-2.7.1-m ultilib-1.patch

On my computers there is
openSUSE 11.3: multilib support
openSUSE 11.4: multilib support
Kubuntu 11.10: no multilib support

In case of multilib support, sys.lib returns 'lib64' (openSUSE 11.4):

Python 2.7 (r27:82500, Aug 07 2010, 16:54:59) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.lib
'lib64'
>>> sys.arch
'x86_64'
>>>

BR

Ewald



IP: --   

Installing Glade on Linux
Keith
Group: Moderator
Post Group: Super Member
Posts: 868
Status:
It sounds like you should get these people to talk to www.python.org. If they want introduce new features they should all get in agreement, until then end users will have a problem.
IP: --   

Installing Glade on Linux
gsuarez
Group: Member
Post Group: Newbie
Posts: 7
Status:
Hello,

I'm trying to install Glade on Ubuntu 12.04 64-bit.  I have python 2.7 but after setting all the variables:

export GLADE_HOME=/home/gsuarez/cad/glade4_linux64_ub10
export PATH=$GLADE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$GLADE_HOME/lib:$LD_LIBRARY_PATH
export PYTHONPATH=/usr/lib/python2.7:$GLADE_HOME/bin

I still get the following, any ideas?

glade
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 68, in <module>
    import os
  File "/usr/lib/python2.7/os.py", line 398, in <module>
    import UserDict
  File "/usr/lib/python2.7/UserDict.py", line 83, in <module>
    import _abcoll
  File "/usr/lib/python2.7/_abcoll.py", line 11, in <module>
    from abc import ABCMeta, abstractmethod
  File "/usr/lib/python2.7/abc.py", line 8, in <module>
    from _weakrefset import WeakSet
  File "/usr/lib/python2.7/_weakrefset.py", line 5, in <module>
    from _weakref import ref
ImportError: No module named _weakref

IP: --   

Installing Glade on Linux
Keith
Group: Moderator
Post Group: Super Member
Posts: 868
Status:
Hi,

Glade is linked to this version of python:

http://www.python.org/download/releases/2.7.3/

I am guessing that the version you have is an earlier version and does not have the _weakref module. If you download and install 2.7.3 from the link above and install it on your machine, it should work OK.

Let me know how you get on,

Keith.

IP: --   

Installing Glade on Linux
gsuarez
Group: Member
Post Group: Newbie
Posts: 7
Status:
Weird thing is I can see the python files

gsuarez@geomachinex:~/cad/glade4_linux64_ub10$ locate weakref.py
/usr/lib/python2.7/weakref.py
/usr/lib/python2.7/weakref.pyc

gsuarez@geomachinex:~/cad/glade4_linux64_ub10$ locate weakrefset.py/usr/lib/python2.7/_weakrefset.py
/usr/lib/python2.7/_weakrefset.pyc

I'll see if I can installed python 2.7.3. Any other ideas?
IP: --   

Installing Glade on Linux
Keith
Group: Moderator
Post Group: Super Member
Posts: 868
Status:
If you just type python at the linux command line and then type 'import os', do you get the same error?

What does 'which python' give, and what version is the one installed?
IP: --   

Installing Glade on Linux
gsuarez
Group: Member
Post Group: Newbie
Posts: 7
Status:
No errors when I run python and it seems I do have version 2.7.3

gsuarez@geomachinex:~/cad/glade4_linux64_ub10$ python
Python 2.7.3 (default, Aug  1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>>

Here's what I get for "which python".
gsuarez@geomachinex:~/cad/glade4_linux64_ub10$ which python
python is /usr/bin/python

And it seems python is just a symbolic link to python2.7
lrwxrwxrwx 1 root root      9 Nov 13 11:11 /usr/bin/python -> python2.7


IP: --   

Installing Glade on Linux
Keith
Group: Moderator
Post Group: Super Member
Posts: 868
Status:
I can only assume that Ubuntu 12.04 comes with a different variant of Python. Can you try installing the www.python.org version 2.7.3 to /usr/local/ and make that one first to be found in $PATH?
IP: --   

Installing Glade on Linux
Ewald
Group: Member
Post Group: Newbie
Posts: 14
Status:
Hello,
I am also running Kubuntu 12.04 LTS 64bit and experienced same trouble as 'gsuarez' and followed your advise to install Phyton 2.7.3 from www.python.org as /usr/local/python2.7.
Still I get same error message when invoking glade 4.3.28 (ubuntu 10.4, 64Bit):
Traceback (most recent call last):
  File "/usr/local/python2.7/lib/python2.7/site.py", line 62, in <module>
    import os
  File "/usr/local/python2.7/lib/python2.7/os.py", line 398, in <module>
    import UserDict
  File "/usr/local/python2.7/lib/python2.7/UserDict.py", line 83, in <module>
    import _abcoll
  File "/usr/local/python2.7/lib/python2.7/_abcoll.py", line 11, in <module>
    from abc import ABCMeta, abstractmethod
  File "/usr/local/python2.7/lib/python2.7/abc.py", line 8, in <module>
    from _weakrefset import WeakSet
  File "/usr/local/python2.7/lib/python2.7/_weakrefset.py", line 5, in <module>
    from _weakref import ref
ImportError: No module named _weakref

How can I help to debug this issue?
My suggestion is to compile glade for ubuntu 12.04 LTS. This version will be supported until 2017, while there is no update support for 10.04 anymore.
Best regards,
Ewald

IP: --   

Installing Glade on Linux
Keith
Group: Moderator
Post Group: Super Member
Posts: 868
Status:
Strange, I can't seem to reproduce the problem here with Ubuntu 10.04. As of Python 2.7.1, _weakref became a builtin, so not sure why it's trying to load it.

Did you download the source and run 'configure', 'make', then 'make altinstall'?

What you you get if you type 'python -v'?
What you you get if you type uname -a'?

I'll look into setting up 12.04 32/64 bit virtual machines in the meantime.
IP: --   

Installing Glade on Linux
Ewald
Group: Member
Post Group: Newbie
Posts: 14
Status:
Hello,

Thanks for the swift reply.

Here  my answers to your questions:

>Did you download the source and run 'configure', 'make', then 'make altinstall'?
=> Not exactly, I ran:

./configure --prefix=/usr/local/python2.7
make
make test
sudo make install

> What you you get if you type 'python -v'?

# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/local/python2.7/lib/python2.7/site.pyc matches /usr/local/python2.7/lib/python2.7/site.py
import site # precompiled from /usr/local/python2.7/lib/python2.7/site.pyc
# /usr/local/python2.7/lib/python2.7/os.pyc matches /usr/local/python2.7/lib/python2.7/os.py
import os # precompiled from /usr/local/python2.7/lib/python2.7/os.pyc
import errno # builtin
import posix # builtin
# /usr/local/python2.7/lib/python2.7/posixpath.pyc matches /usr/local/python2.7/lib/python2.7/posixpath.py
import posixpath # precompiled from /usr/local/python2.7/lib/python2.7/posixpath.pyc
# /usr/local/python2.7/lib/python2.7/stat.pyc matches /usr/local/python2.7/lib/python2.7/stat.py
import stat # precompiled from /usr/local/python2.7/lib/python2.7/stat.pyc
# /usr/local/python2.7/lib/python2.7/genericpath.pyc matches /usr/local/python2.7/lib/python2.7/genericpath.py
import genericpath # precompiled from /usr/local/python2.7/lib/python2.7/genericpath.pyc
# /usr/local/python2.7/lib/python2.7/warnings.pyc matches /usr/local/python2.7/lib/python2.7/warnings.py
import warnings # precompiled from /usr/local/python2.7/lib/python2.7/warnings.pyc
# /usr/local/python2.7/lib/python2.7/linecache.pyc matches /usr/local/python2.7/lib/python2.7/linecache.py
import linecache # precompiled from /usr/local/python2.7/lib/python2.7/linecache.pyc
# /home/ewald/Kubuntu/tarballs/glade4_linux64_ub10/bin/types.pyc matches /home/ewald/Kubuntu/tarballs/glade4_linux64_ub10/bin/types.py
import types # precompiled from /home/ewald/Kubuntu/tarballs/glade4_linux64_ub10/bin/types.pyc
# /usr/local/python2.7/lib/python2.7/UserDict.pyc matches /usr/local/python2.7/lib/python2.7/UserDict.py
import UserDict # precompiled from /usr/local/python2.7/lib/python2.7/UserDict.pyc
# /usr/local/python2.7/lib/python2.7/_abcoll.pyc matches /usr/local/python2.7/lib/python2.7/_abcoll.py
import _abcoll # precompiled from /usr/local/python2.7/lib/python2.7/_abcoll.pyc
# /usr/local/python2.7/lib/python2.7/abc.pyc matches /usr/local/python2.7/lib/python2.7/abc.py
import abc # precompiled from /usr/local/python2.7/lib/python2.7/abc.pyc
# /usr/local/python2.7/lib/python2.7/_weakrefset.pyc matches /usr/local/python2.7/lib/python2.7/_weakrefset.py
import _weakrefset # precompiled from /usr/local/python2.7/lib/python2.7/_weakrefset.pyc
import _weakref # builtin
# /usr/local/python2.7/lib/python2.7/copy_reg.pyc matches /usr/local/python2.7/lib/python2.7/copy_reg.py
import copy_reg # precompiled from /usr/local/python2.7/lib/python2.7/copy_reg.pyc
# /usr/local/python2.7/lib/python2.7/traceback.pyc matches /usr/local/python2.7/lib/python2.7/traceback.py
import traceback # precompiled from /usr/local/python2.7/lib/python2.7/traceback.pyc
# /usr/local/python2.7/lib/python2.7/sysconfig.pyc matches /usr/local/python2.7/lib/python2.7/sysconfig.py
import sysconfig # precompiled from /usr/local/python2.7/lib/python2.7/sysconfig.pyc
# /usr/local/python2.7/lib/python2.7/re.pyc matches /usr/local/python2.7/lib/python2.7/re.py
import re # precompiled from /usr/local/python2.7/lib/python2.7/re.pyc
# /usr/local/python2.7/lib/python2.7/sre_compile.pyc matches /usr/local/python2.7/lib/python2.7/sre_compile.py
import sre_compile # precompiled from /usr/local/python2.7/lib/python2.7/sre_compile.pyc
import _sre # builtin
# /usr/local/python2.7/lib/python2.7/sre_parse.pyc matches /usr/local/python2.7/lib/python2.7/sre_parse.py
import sre_parse # precompiled from /usr/local/python2.7/lib/python2.7/sre_parse.pyc
# /usr/local/python2.7/lib/python2.7/sre_constants.pyc matches /usr/local/python2.7/lib/python2.7/sre_constants.py
import sre_constants # precompiled from /usr/local/python2.7/lib/python2.7/sre_constants.pyc
import encodings # directory /usr/local/python2.7/lib/python2.7/encodings
# /usr/local/python2.7/lib/python2.7/encodings/__init__.pyc matches /usr/local/python2.7/lib/python2.7/encodings/__init__.py
import encodings # precompiled from /usr/local/python2.7/lib/python2.7/encodings/__init__.pyc
# /usr/local/python2.7/lib/python2.7/codecs.pyc matches /usr/local/python2.7/lib/python2.7/codecs.py
import codecs # precompiled from /usr/local/python2.7/lib/python2.7/codecs.pyc
import _codecs # builtin
# /usr/local/python2.7/lib/python2.7/encodings/aliases.pyc matches /usr/local/python2.7/lib/python2.7/encodings/aliases.py
import encodings.aliases # precompiled from /usr/local/python2.7/lib/python2.7/encodings/aliases.pyc
# /usr/local/python2.7/lib/python2.7/encodings/utf_8.pyc matches /usr/local/python2.7/lib/python2.7/encodings/utf_8.py
import encodings.utf_8 # precompiled from /usr/local/python2.7/lib/python2.7/encodings/utf_8.pyc
Python 2.7.3 (default, Jan 19 2013, 14:24:14)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

> What you you get if you type uname -a'?
Linux STICK01 3.2.0-36-generic #57-Ubuntu SMP Tue Jan 8 21:44:52 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Best regards,

Ewald

IP: --   

Installing Glade on Linux
Ewald
Group: Member
Post Group: Newbie
Posts: 14
Status:
Hello again,

For completeness:

'configure', 'make', then 'make altinstall' did not change the result.
Still same traceback of errors.

Best regards,

Ewald
IP: --   

« Previous    Next »

Threaded Mode | Print  

2


Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is November 16, 2018, 4:59 pm.

  Powered By AEF 1.0.9 © 2007-2011 Electron Inc.Queries: 12  |  Page Created In:0.044