Mac client on Leopard

A place for general chatter about games in progress, games completed, strategy advice, bug reports, or really anything at all that relates in some vague way to RSW.
Post Reply
miho
Posts: 4
Joined: Wed Feb 06, 2008 3:23 pm

Mac client on Leopard

Post by miho »

I get the following error when I try and run the latest client on my Mac:

ImportError: No module named wx

I suspect it has something to do with the wx toolkit but not sure if the client uses that or not.

Any help is appreciated.

Thanks,

Steve
drwr
Posts: 636
Joined: Sat Dec 10, 2005 10:56 am
Location: Glendale, CA
Contact:

Re: Mac client on Leopard

Post by drwr »

Hmm, have you been able to run any prior versions of the client, or is this the first one you've tried?

The RSW client does absolutely require the wx toolkit to be installed, as well as the wxPython wrappers.

I'm kind of Mac-naive, though, and since this was already installed by default on my own OS X Tiger box, I assumed it would be installed by default on everyone's OS X Tiger and above. Is that not the case?

David
miho
Posts: 4
Joined: Wed Feb 06, 2008 3:23 pm

Re: Mac client on Leopard

Post by miho »

Well, the wxPython web claims it is default installed on 10.5. I tried to upgrade to a newer version, which required a "framework" version of python to be installed. I installed all of these and changed the python symlink in the RSW Client directory to point to the newly installed version and that didn't work either. I am not sure if the paths are hard coded anywhere in the RSW binary itself.

Also, this is the first time I have tried to run it. Brand new to the game. :)

If any information I can provide would help resolve this, please let me know.

Thanks,

Steve
drwr
Posts: 636
Joined: Sat Dec 10, 2005 10:56 am
Location: Glendale, CA
Contact:

Re: Mac client on Leopard

Post by drwr »

Hmm. Maybe it's the presence of multiple versions of python that's causing trouble?

On my Mac, I have a /usr/bin/python, which is symlinked to /usr/bin/python2.3. When I invoke this:
newt:~> python
Python 2.3.5 (#1, Dec 25 2005, 07:24:19)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>>
It works fine. But I also have another version of Python installed, which I installed from a custom build, and this other version doesn't include wx:
newt:~> python2.4
Python 2.4.3 (#1, Sep 27 2006, 12:30:22)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named wx
>>>
So which version of Python do you get for just running "python"? Is it the right one, and can you successfully run the command "import wx" within that interpreter?

The RSW Client bundle was assembled by a third-party program called py2app, and I'm not honestly sure what kind of paths it burns into that binary, but I'm pretty sure it doesn't include any hard-coded paths. Certainly none of my own code has any paths to a specific version of Python; it all depends on whatever it find on the system path. I do see that there is a symlink to python in the MacOS directory, but I didn't put it there, and it doesn't appear to be used (I just tried an experiment, moving mine to point to the wrong version of python, and it still ran fine, loading the right one).

David
miho
Posts: 4
Joined: Wed Feb 06, 2008 3:23 pm

Re: Mac client on Leopard

Post by miho »

Something is a little strange. I just ran the following test:

[~]$ ls -l /usr/bin/python
lrwxr-xr-x 1 root wheel 72 Nov 6 12:20 /usr/bin/python -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python
[~]$ python
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>>

and I had no errors importing wx. I removed all my previous versions I had just installed and still get the error. I'll keep looking into it more and let you know if I find a fix.

Regards,

Steve
drwr
Posts: 636
Joined: Sat Dec 10, 2005 10:56 am
Location: Glendale, CA
Contact:

Re: Mac client on Leopard

Post by drwr »

If you're not able to find a workaround easily, try downloading and running the RSW client via Python source. You should be able to unpack it into any directory, and then run "python rsw_client.py" (or even just rsw_client.py) from within that directory.

David
miho
Posts: 4
Joined: Wed Feb 06, 2008 3:23 pm

Re: Mac client on Leopard

Post by miho »

drwr wrote:If you're not able to find a workaround easily, try downloading and running the RSW client via Python source. You should be able to unpack it into any directory, and then run "python rsw_client.py" (or even just rsw_client.py) from within that directory.

David

This worked just fine. Must be something with leopard and the wrappers.

Thanks,

Steve
drwr
Posts: 636
Joined: Sat Dec 10, 2005 10:56 am
Location: Glendale, CA
Contact:

Re: Mac client on Leopard

Post by drwr »

I'll update to Leopard and see if I get the same problem.

David
drwr
Posts: 636
Joined: Sat Dec 10, 2005 10:56 am
Location: Glendale, CA
Contact:

Re: Mac client on Leopard

Post by drwr »

Got a handle on the problem. I've got an idea for a new way to package up the Mac release that doesn't depend (much) on the software already installed on the system. I'll work on this for future releases; in the meantime, please let me know if you have issues with the source release.

David
Post Reply