Isotropix Forums

Can't get Python to work on linux

Clarisse Scripting related topics

Can't get Python to work on linux

Unread postby varomix » Thu Dec 10, 2015 12:51 am

Hey guys
I can't seem to make python to work, I'm on linux mint
I get this errors
00:00:05 Traceback (most recent call last):
00:00:05 File "<string>", line 1, in <module>
00:00:05 AttributeError: 'module' object has no attribute 'AppBase'
00:00:05 Traceback (most recent call last):
00:00:05 File "<string>", line 2, in <module>
00:00:05 AttributeError: 'module' object has no attribute 'PyEventObjectHandler'
00:00:05 Traceback (most recent call last):
00:00:05 File "<string>", line 2, in <module>
00:00:05 AttributeError: 'module' object has no attribute 'PyGuiGarbageCollector'
00:00:05 Traceback (most recent call last):
00:00:05 File "<string>", line 1, in <module>
00:00:05 NameError: name '__ix_session_event_object_handler__' is not defined
00:00:05 Traceback (most recent call last):
00:00:05 File "<string>", line 1, in <module>
00:00:05 NameError: name '__ix_session_gui_garbage_collector__' is not defined
00:00:05


This is my clarisse.env
PYTHONHOME=/usr/lib/python2.7
PYTHONPATH=/home/varomix/bin/isotropix_clarisse_ifx_2.0_sp6_linux64/clarisse/python:/usr/lib/python2.7:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/lib/python2.7:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload

seems like I'm missing something
Thanks for the help
varomix
 
Posts: 5
Joined: Sat Jan 26, 2013 12:33 am

Re: Can't get Python to work on linux

Unread postby varomix » Mon Dec 14, 2015 10:54 pm

Hi

I solved this had to do a few things

Clarisse wants to load the 2.6 python library so I cheated
error: libpython2.6.so.1.0: cannot open shared object file: No such file or directory

By doing this
Code: Select all
sudo ln -s /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 /usr/lib/libpython2.6.so.1.0


once that works and you have the correct env settings, se below
you need to fix this error
ImportError: No module named site

A know bug in Ubuntu based distros
Code: Select all
sudo ln -s /usr/lib/python2.7/plat-*/_sysconfigdata_nd.py /usr/lib/python2.7/


This still might give you the SITE error or that the PYTHONHOME and PYTHONPATH are not set or something
so for Clarisse to just use what ever is set in the clarisse.env file we clear any previous variables
I edited the clarisse launch script directly and added this just below #!/bin/bash
unset PYTHONHOME
unset PYTHONPATH


clarisse.env this is the file here >> /home/username/.isotropix/clarisse.env
PYTHONHOME=/usr/lib/python2.7
PYTHONPATH=/home/varomix/bin/isotropix_clarisse_ifx_2.0_sp6_linux64/clarisse/python:/usr/lib/python2.7:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu/:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload


and now it works great

if anyone else needs help let me know

Cheers!!
varomix
 
Posts: 5
Joined: Sat Jan 26, 2013 12:33 am

Re: Can't get Python to work on linux

Unread postby julien » Tue Dec 15, 2015 11:50 am

Hi,
Clarisse 2.0 wants python 2.6 so you did the right thing if you only have the 2.7 version installed, since its compatible.

I think your PYTHONHOME is not right since it points to a lib folder and PYTHONHOME is about python executable binary. Since Clarisse does not use python executable directly but only libraries it does not shows up.

Have a good day!

Regards
User avatar
julien
 
Posts: 275
Joined: Mon Nov 18, 2013 7:30 pm

Re: Can't get Python to work on linux

Unread postby linuxmarc » Sat Apr 15, 2017 10:03 pm

Trying to run Clarisse 3 SP9 PLE on my Ubuntu 16.04
First I got the missing
Code: Select all
 libpython2.7.so
error, so I made a symlink in
Code: Select all
/usr/lib/x86_64-linux-gnu
to
Code: Select all
libpython2.7.so.1.0


Now everytime I try to start clarisse, shortly after the splash, I get: 
Code: Select all
ImportError: No module named site


Tried all the things mentioned above, but still not able to start and try clarisse.
Is there any fix? I'd love to test this.... :)
linuxmarc
 
Posts: 2
Joined: Sat Apr 15, 2017 9:55 pm

Re: Can't get Python to work on linux

Unread postby julien » Tue Apr 18, 2017 11:54 am

Hi,
I have it working on a regular Ubuntu 16.04 with this PYTHONPATH value in clarisse.env:
Code: Select all
PYTHONPATH=/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload


Regards
User avatar
julien
 
Posts: 275
Joined: Mon Nov 18, 2013 7:30 pm

Re: Can't get Python to work on linux

Unread postby linuxmarc » Sat Apr 22, 2017 4:39 pm

Thanks!

Your solution worked perfect!
linuxmarc
 
Posts: 2
Joined: Sat Apr 15, 2017 9:55 pm

Re: Can't get Python to work on linux

Unread postby ryder » Wed Aug 16, 2017 4:41 pm

julien wrote:Hi,
I have it working on a regular Ubuntu 16.04 with this PYTHONPATH value in clarisse.env:
Code: Select all
PYTHONPATH=/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload


Regards


Hi, sorry to bump a old topic. But I'm configuring couple of Linux machine to run Clarisse and got errors:

after change my env to this path you posted:
I still got "ImportError: No module named site"

I'm on Lubuntu(ubuntu core 17.04) with Clarisse 3.5.

thanks in advance.
ryder
 
Posts: 21
Joined: Sun Mar 17, 2013 5:08 am

Re: Can't get Python to work on linux

Unread postby anemoff » Fri Aug 18, 2017 11:00 am

Hi,

Can you please send us the output of these commands to verify your settings?

Where is python installed?
If the output says "no python in ..." it means python is not known by the system. Maybe it is installed but the system doesn't know where.
Code: Select all
which python

If python is indeed installed, what version do you have?
Clarisse requires version 2.7.x. If you have python 3.x you will need to install python 2.7.x too.
Code: Select all
python -V

What are your environment variables?
Code: Select all
printenv

We haven't tried using Clarisse on Ubuntu 17.04. We will try it and come back to you if we have useful information to share.

Sorry for the inconvenience.

Regards,
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 65
Joined: Wed Jan 13, 2016 11:10 am

Re: Can't get Python to work on linux

Unread postby anemoff » Fri Aug 18, 2017 2:23 pm

We have successfully tested Clarisse 3.5 on Ubuntu 17.04 (and Lubuntu 17.04).

This what you need to do:
Code: Select all
sudo ln -sf /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 /usr/lib/x86_64-linux-gnu/libpython2.7.so

and
Code: Select all
export PYTHONHOME=/usr/


Can you try and tell us if you still have problems running Clarisse?

Cheers,
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 65
Joined: Wed Jan 13, 2016 11:10 am

Re: Can't get Python to work on linux

Unread postby ryder » Fri Aug 18, 2017 7:52 pm

anemoff wrote:We have successfully tested Clarisse 3.5 on Ubuntu 17.04 (and Lubuntu 17.04).

This what you need to do:
Code: Select all
sudo ln -sf /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 /usr/lib/x86_64-linux-gnu/libpython2.7.so

and
Code: Select all
export PYTHONHOME=/usr/


Can you try and tell us if you still have problems running Clarisse?

Cheers,



Hi anemoff, sorry for the late reply.

I tested at my home with PLE on lubuntu 17.04 , and it worked! Clarisse run Perfectly Smooth! tho the sad part of story is the shop i work for decided to switch back to 16.04 after i failed...

again, thank you so muck for your help! :D
ryder
 
Posts: 21
Joined: Sun Mar 17, 2013 5:08 am

Next

Return to Scripting