[RESOLVED] Mac seems to choke on python universe generation.

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Post Reply
Message
Author
User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

[RESOLVED] Mac seems to choke on python universe generation.

#1 Post by eleazar »

I haven't been able to get the last couple mac binaries to work.

SVN 6654 loads up and runs, but there is absolutely nothing in the universe-- no stars, planets, or empires.

Code: Select all

2014-01-31 12:24:54,318 ERROR Server : Unable to import universe generator script
2014-01-31 12:24:54,318 ERROR Server : Traceback (most recent call last):
2014-01-31 12:24:54,318 ERROR Server :   File "/Users/jbjerk/Desktop/FreeOrion.app/Contents/Resources/default/UniverseGenerator.py", line 2, in <module>
2014-01-31 12:24:54,318 ERROR Server :     import random
2014-01-31 12:24:54,318 ERROR Server :   File "/Users/jbjerk/Desktop/FreeOrion.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/random.py", line 47, in <module>
2014-01-31 12:24:54,318 ERROR Server :     from os import urandom as _urandom
2014-01-31 12:24:54,318 ERROR Server : ImportError: cannot import name urandom
Attached are the logs.

The very latest version fails differently-- something about not being able to contact the server. That's probably the more relevant issue, and i'm re-downloading the latest binary so i can try and describe that one too.
Attachments
logs.zip
(18.47 KiB) Downloaded 161 times

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Mac seems to choke on python universe generation.

#2 Post by eleazar »

SVN 6756

This binary downloaded much more quickly than last time.

After selecting settings, and working for a while i get a black screen and:
"The connection to the server has been lost."

Code: Select all

2014-01-31 12:35:38,849 ERROR Server : Unable to import universe generator script
2014-01-31 12:35:38,849 ERROR Server : Traceback (most recent call last):
2014-01-31 12:35:38,849 ERROR Server :   File "/Users/jbjerk/Desktop/FreeOrion.app/Contents/Resources/default/UniverseGenerator.py", line 2, in <module>
2014-01-31 12:35:38,849 ERROR Server :     import random
2014-01-31 12:35:38,849 ERROR Server :   File "/Users/jbjerk/Desktop/FreeOrion.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/random.py", line 47, in <module>
2014-01-31 12:35:38,849 ERROR Server :     from os import urandom as _urandom
2014-01-31 12:35:38,849 ERROR Server : ImportError: cannot import name urandom
Attachments
6756 logs.zip
(14.83 KiB) Downloaded 171 times

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Mac seems to choke on python universe generation.

#3 Post by Geoff the Medio »

It often helps to google the error message. I don't know if that makes any sense, but can you try something similar?

It might be trying to load your system Python install which is possibly a different version from what comes in the app bundle...?

This sounds similar to issues Vezzra has been dealing with, as discussed here: https://sourceforge.net/p/freeorion/bugs/553/
and here: viewtopic.php?p=67382#p67382

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Mac seems to choke on python universe generation.

#4 Post by Vezzra »

Geoff the Medio wrote:It might be trying to load your system Python install which is possibly a different version from what comes in the app bundle...?

This sounds similar to issues Vezzra has been dealing with, as discussed here: https://sourceforge.net/p/freeorion/bugs/553/
and here: viewtopic.php?p=67382#p67382
Yep, that's exactly what's happening here, and exactly the same error message I found in the server log provided with this bug report. I've already committed a fix to ensure the Python framework bundled with the FO app gets used, hopefully that takes care of this problem.

@eleazar: The upcoming Moday test build will already include the fix, please report back if that build works on your system.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Mac seems to choke on python universe generation.

#5 Post by Geoff the Medio »

Vezzra wrote:@eleazar: The upcoming Moday test build will already include the fix, please report back if that build works on your system.
Any chance you can make an OSX build today? Kind of an important issue, and a waste of a weekend's potential work...

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Mac seems to choke on python universe generation.

#6 Post by eleazar »

Geoff the Medio wrote:Kind of an important issue, and a waste of a weekend's potential work...
As far as i'm concerned, it won't make much difference.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Mac seems to choke on python universe generation.

#7 Post by Vezzra »

Geoff the Medio wrote:Any chance you can make an OSX build today? Kind of an important issue, and a waste of a weekend's potential work...
Done.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Mac seems to choke on python universe generation.

#8 Post by Vezzra »

eleazar wrote:
Geoff the Medio wrote:Kind of an important issue, and a waste of a weekend's potential work...
As far as i'm concerned, it won't make much difference.
Too late :mrgreen:

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Mac seems to choke on python universe generation.

#9 Post by eleazar »

Fix confirmed. :)

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: [RESOLVED] Mac seems to choke on python universe generat

#10 Post by adrian_broher »

Did you commit the change to the project file Vezzra? I don't see any commit containing which contained this.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [RESOLVED] Mac seems to choke on python universe generat

#11 Post by Geoff the Medio »

adrian_broher wrote:Did you commit the change to the project file Vezzra? I don't see any commit containing which contained this.
https://sourceforge.net/p/freeorion/code/6774/

(Not a project file change...)

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: [RESOLVED] Mac seems to choke on python universe generat

#12 Post by adrian_broher »

Geoff the Medio wrote:(Not a project file change...)
Okay, I expected one, but seems like he didn't came around yet.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: [RESOLVED] Mac seems to choke on python universe generat

#13 Post by Vezzra »

adrian_broher wrote:Did you commit the change to the project file Vezzra? I don't see any commit containing which contained this.
adrian_broher wrote:
Geoff the Medio wrote:(Not a project file change...)
Okay, I expected one, but seems like he didn't came around yet.
The fix I committed (rev 6774) was the "quick and dirty" one, which I referred to in the thread you linked and want to replace with a more elegant solution. But as you mentioned there, that will require some fiddling, and I've already more on my plate than I can handle ATM, so I decided I'll get around to that later. The "quick and dirty" fix works, it has for years actually (as it had to be done for the AI clients also), so there's no pressure to implement the better fix immediately.

Post Reply