You are not logged in.

#1 2005-10-13 19:58:16

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 787

PYTHONHOME?

I'm trying to play a game and it doesn't quite work properly.  I get the following error:

 Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]

I have no idea where to set PYTHONHOME to - can anyone point me in the right direction?

Offline

#2 2005-10-13 20:10:59

jftaylor21
Member
From: Arch Linux Forums
Registered: 2004-02-21
Posts: 237

Re: PYTHONHOME?

man python

PYTHONHOME
    Change the location of the standard Python libraries. By default, the libraries are searched in   ${prefix}/lib/python<version> and ${exec_prefix}/lib/python<version>, where ${prefix} and ${exec_prefix} are installation-dependent directories, both defaulting to /usr/local. When $PYTHONHOME is set to a single directory, its value replaces both ${prefix} and ${exec_prefix}. To specify different values for these, set $PYTHONHOME to ${prefix}:${exec_prefix}.

Sounds like it needs to point to /usr/lib/python2.4/
I haven't tried it though, but maybe this will help.

Offline

#3 2005-10-13 20:24:18

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 787

Re: PYTHONHOME?

I've tried that and that error goes away - but the game still doesn't work as expected.  Which either means that the python thing was a red herring or that /usr/lib/python2.4 isn't right.  I did also try setting it to /usr/include/python2.4...

I also get the following error regardless of whether it's set or not:

Traceback (most recent call last):
  File "<string>", line 1, in ?
ImportError: No module named random

Offline

#4 2005-10-13 20:49:00

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: PYTHONHOME?

Missing dependency?

Offline

#5 2005-10-13 20:52:54

jftaylor21
Member
From: Arch Linux Forums
Registered: 2004-02-21
Posts: 237

Re: PYTHONHOME?

What game are you trying to play? It looks like it can't find the random module which I assume would be random.py which is located in the /usr/lib/python2.4 directory. I don't know a lot about python so I don't know if I were to trust me. tongue
Maybe the first step would be to confirm that the file is there. If it is not, try reinstalling python and see if that helps. Is this an official package or are you trying to package it yourself?

Offline

#6 2005-10-13 21:16:51

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 787

Re: PYTHONHOME?

random.py is there.  I had already tried reinstalling python though.  I tried setting both PYTHONHOME and PYTHONPATH to /usr/lib/python2.4 and now the random module is found - but still doesn't work properly - it throws the following errors:

'import site' failed; use -v for traceback
/usr/lib/python2.4/types.py:52: Warning: 'yield' will become a reserved keyword in the future
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "/usr/lib/python2.4/random.py", line 42, in ?
    from warnings import warn as _warn
  File "/usr/lib/python2.4/warnings.py", line 6, in ?
    import sys, types
  File "/usr/lib/python2.4/types.py", line 52
    yield 1
          ^
SyntaxError: invalid syntax
Vertex3f: 2
Normal3f: 1
TexCoord2f: 1

Some of that may be other output from the game and not all python.

The game is neither an official package nor one that I'm making - I just unzipped the tar file.  Essentially it works perfectly except for when it's supposed to run python scripts in which case, with one exception, it just doesn't run them - but no further error is given...

Offline

#7 2005-10-13 21:25:21

jftaylor21
Member
From: Arch Linux Forums
Registered: 2004-02-21
Posts: 237

Re: PYTHONHOME?

Well I don't know if I can help you with a syntax error. It looks like a problem with the original program. You might want to contact the developer of the game about it or do a google search to see if anyone else has encountered similar problems.

Offline

#8 2005-10-14 16:16:17

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 787

Re: PYTHONHOME?

The syntax error might be a red herring.  I've tried running some of the python scripts and they all turn up the following error:

ImportError: No module named eventAPI

There is nothing called eventAPI in /usr/lib/python2.4 - I wonder if the lack of this module might be an issue...

Offline

#9 2005-10-14 19:39:08

jftaylor21
Member
From: Arch Linux Forums
Registered: 2004-02-21
Posts: 237

Re: PYTHONHOME?

I did a google search on "eventapi python" but it didn't turn up anything. The only thing that I can think of is that:
A) The Arch Linux python package is somehow missing it.
B) Missing dependency like snowman suggested
C) Something wrong with the program.

What game are you trying to compile? Maybe googling that will help.

Offline

#10 2005-10-14 19:42:58

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 787

Re: PYTHONHOME?

The game is Devil Whiskey.  I'm not even trying to compile it.  I just downloaded binaries in a tar file and extracted it...

Offline

#11 2005-10-14 20:53:49

mpie
Member
From: 404 Not found
Registered: 2005-03-06
Posts: 649

Re: PYTHONHOME?

log out and back in again this can help sometimes with wonky python

if you have just downloaded it extracted it and are trying to run it, if you have already tried tis ignore me:)

deps show as sdl sdlmixer SMPEG and zlib....

do you have smpeg installed?

Offline

#12 2005-10-14 21:18:08

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 787

Re: PYTHONHOME?

I have all of those installed and have rebooted since the install...

Offline

#13 2005-10-15 20:38:33

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 787

Re: PYTHONHOME?

I know it's a big ask, but is there any chance someone else could install the demo and tell me if it works for them?  I can get the game running but if I go into some buildings - which should trigger an event in python and run a script - I get nothing but an empty building.

If you don't get the same problem we can compare packages installed, and if you do then we can assume it's something to do with how arch is set up...

Offline

#14 2005-10-21 19:37:30

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 787

Re: PYTHONHOME?

One of the deps is python 2.2 and I have 2.4.  Is it possible that some deprectated APIs are being used or something like that...?

If so, what's the best way to install 2.2 and could I have both versions alongside each other.  For example python 2.4 could be my base installation of python, but 2.2 would be installed somewhere and the script that starts the game could set PYTHONHOME and PYTHONPATH to the 2.2 installation...

Does that make sense?  Would it work?

Offline

#15 2005-10-21 19:40:43

mpie
Member
From: 404 Not found
Registered: 2005-03-06
Posts: 649

Re: PYTHONHOME?

yep there were mass breakages from 2.2 to 2.3....

Offline

#16 2005-10-22 09:10:53

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 787

Re: PYTHONHOME?

OK - so it sounds like it's worth trying then...

I went to the python page to see if I could download python, but it's only available as RPMs... also I want to be able to make sure I can install it in such a way that it doesn't overwrite my 2.4 install...

I'm a bit clueless at this point...

Offline

#17 2005-10-22 09:27:24

mpie
Member
From: 404 Not found
Registered: 2005-03-06
Posts: 649

Re: PYTHONHOME?

install it in /opt is your looking to make a pkg
or just extract to your home if its jusy for personal use

probalby worth adding the path to is to /etc/ld.so.conf
and /etc/profile.d

look at the other scripts in there for an example

usr rpmunpack to extract the files and copy thm to

Offline

#18 2005-10-22 15:22:55

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 787

Re: PYTHONHOME?

I installed it in /usr/local and edited the script to use that for it's PYTHONHOME and PYTHONPATH.

Seems to have worked  big_smile

and 2.4 is still the default python...

Offline

Board footer

Powered by FluxBB