Page 1 of 1

VS doesn't load right -- ImportError on modules/vsrandom.py

Posted: Sun Jul 28, 2013 7:05 pm
by ermo
I'm seeing some interesting behaviour with my locally compiled r13636, as it appears that the statement "from __future__ import print_function" fails when loading the game, yet it works fine when executed in a python 2.7.5 interpreter started from the command line on the same system. I used the system boost and installed boost-devel, which pulls in boost-python, which is presumably linked against python-2.7.5 (how do I double check this?).

Here's what the standard game log looks like with a small patch which shows the python version that runs the script which fails after I run (a symbolic link to) "./vegastrike" in data/:

Code: Select all

Registering codec ogg.
 In path /home/ermo/VegaStrike/trunk/vegastrike/build
Vega Strike  
See http://www.gnu.org/copyleft/gpl.html for license details.

GOT SUBDIR ARG = 
Found data in /home/ermo/VegaStrike/trunk/data
Using /home/ermo/VegaStrike/trunk/data as data directory
Using .vegastrike as the home directory
Found MODDIR = /home/ermo/VegaStrike/trunk/data/mods
USING HOMEDIR : /home/ermo/.vegastrike As the home directory 
CONFIGFILE - Found a config file in home directory, using : /home/ermo/.vegastrike/vegastrike.config
DATADIR - No datadir specified in config file, using ; /home/ermo/VegaStrike/trunk/data
SIMULATION_ATOM: 0.01
MISSION_NAME is empty using : main_menu.mission
running import sys
print(sys.path)
sys.path = ["",r"/home/ermo/VegaStrike/trunk/data/modules/builtin",r"/home/ermo/VegaStrike/trunk/data/modules/quests",r"/home/ermo/VegaStrike/trunk/data/modules/missions",r"/home/ermo/VegaStrike/trunk/data/modules/ai",r"/home/ermo/VegaStrike/trunk/data/modules",r"/home/ermo/VegaStrike/trunk/data/bases"] + sys.path
testing VS randomrunning import sys
print(sys.path)
['/usr/lib64/python27.zip', '/usr/lib64/python2.7/', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload']
['', '/home/ermo/VegaStrike/trunk/data/modules/builtin', '/home/ermo/VegaStrike/trunk/data/modules/quests', '/home/ermo/VegaStrike/trunk/data/modules/missions', '/home/ermo/VegaStrike/trunk/data/modules/ai', '/home/ermo/VegaStrike/trunk/data/modules', '/home/ermo/VegaStrike/trunk/data/bases', '/usr/lib64/python27.zip', '/usr/lib64/python2.7/', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload']
Creating scene manager...
Creating template manager...
  Initializing renderer...
0 joysticks were found.

The names of the joysticks are:
radeon: Acquired access to Hyper-Z.
FactionXML:LoadXML factions.xml
Min (0.000000, 0.000000, 0.000000) Max(0.000000, 0.000000, 0.000000) MinLumin 1.000000, MaxLumin 1.000000Read In Star Count 0 used: 2000
Min (0.000000, 0.000000, 0.000000) Max(0.000000, 0.000000, 0.000000) MinLumin 1.000000, MaxLumin 1.000000Read In Star Count 0 used: 38
using NV_CUBE_MAP
Loading a starsystem
Loading Star System Special/Empty
FOUND MODIFICATION = player FOR PLAYER #0
CREATING A LOCAL SHIP : dumbfire
Hi helper play 0
HereInitializing optimizer
Compilation of technique fixed successful
Compilation of technique default successful
Compilation of technique default_simple successful
pox 119990000000.000000 -9000000.000000 -109990000000.000000

!! --
!!
!! vsrandom.py is being interpreted by python version:

2.7.5 (default, Jul  8 2013, 09:48:59) 
[GCC 4.8.1 20130603 (Red Hat 4.8.1-1)]

!! and the python sys.path looks like this:

['', '/home/ermo/VegaStrike/trunk/data/modules/builtin', '/home/ermo/VegaStrike/trunk/data/modules/quests', '/home/ermo/VegaStrike/trunk/data/modules/missions', '/home/ermo/VegaStrike/trunk/data/modules/ai', '/home/ermo/VegaStrike/trunk/data/modules', '/home/ermo/VegaStrike/trunk/data/bases', '/usr/lib64/python27.zip', '/usr/lib64/python2.7/', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload']

!! --

Traceback (most recent call last):
  File "main_menunightprivateer.py", line 7, in <module>
  File "/home/ermo/VegaStrike/trunk/data/bases/computer_lib.py", line 5, in <module>
    import universe
  File "/home/ermo/VegaStrike/trunk/data/modules/universe.py", line 9, in <module>
    import vsrandom
  File "/home/ermo/VegaStrike/trunk/data/modules/vsrandom.py", line 74, in <module>
    from __future__ import print_function, division
ImportError: cannot import name print_function
ERROR: there are no rooms in basefile "main_menunight.py" ...
Traceback (most recent call last):
  File "<string>", line 8, in <module>
  File "/home/ermo/VegaStrike/trunk/data/modules/missions/privateer.py", line 1, in <module>
    from trading import trading
  File "/home/ermo/VegaStrike/trunk/data/modules/trading.py", line 2, in <module>
    import vsrandom
  File "/home/ermo/VegaStrike/trunk/data/modules/vsrandom.py", line 74, in <module>
    from __future__ import print_function, division
ImportError: cannot import name print_function
Force feedback support disabled when compiled
Loading completed, now network init
Loading active missions True
radeon: Released access to Hyper-Z.
Shutting down renderer...
Thank you for playing!
Writing Save Game Autosave-main_menuHi helper play 0
AL lib: (WW) FreeDevice: (0x25407b0) Deleting 1 Buffer(s)
Here

Re: VS doesn't load right -- ImportError on modules/vsrandom

Posted: Sun Jul 28, 2013 9:37 pm
by klauss
You can also tell it's using 2.7 by checking the include path (it points to 2.7).

It's certainly weird behavior. Weird and distribution-specific.

Please attach your CMakeCache.txt (it's in the build folder), and the link command right at the end of a verbose build. That should hold the detail of what is linked to what.

Also some detailed info about your distribution and related package versions, so I may check their sources to see if they have anything nonstandard in them.

Re: VS doesn't load right -- ImportError on modules/vsrandom

Posted: Mon Jul 29, 2013 6:45 pm
by ermo
I just re-installed my f19 OS on the same box and then re-downloaded the VS trunk source and compiled it.

The result? No issues whatsoever, so my installation must have been partially corrupt (it was an old install, which had been upgraded from a prior version of fedora).

Case closed as far as I'm concerned.

Re: VS doesn't load right -- ImportError on modules/vsrandom

Posted: Mon Jul 29, 2013 6:54 pm
by klauss
So... the windows treatment worked :?

Cool that it works tho :)

Re: VS doesn't load right -- ImportError on modules/vsrandom

Posted: Mon Jul 29, 2013 8:39 pm
by loki1950
klauss wrote:So... the windows treatment worked :?

Cool that it works tho :)
Not really fedora has always recommended clean installs and has only recently introduced a distro update system and results have been a bit mixed that's just from my own experience and fedora forum reading over the years since fedora core 3 :|

Enjoy the Choice :)

Re: VS doesn't load right -- ImportError on modules/vsrandom

Posted: Tue Jul 30, 2013 5:42 am
by pheonixstorm
klauss wrote:So... the windows treatment worked :?

Cool that it works tho :)
Hope the "windows" treatment doesn't become a trend for other linux distros :roll: