Need help with installing Python (for NMLC)

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Need help with installing Python (for NMLC)

Post by Hyronymus »

I'm trying to install Python and all required libraries so I can try NMLC. Python seems to install fine but when I try to install the required image libary it says no installed version of Python is available.

I looked here but I don't get how to install PLY either (it doesn't have a Windows installer)! Can someone guide me through the setup in a more elaborate way?

BTW: PIL requires Python 2.6 at best. In formentioned link it says you can choose Python 2.0 - 2.7, is that correct then?
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: Need help with installing Python (for NMLC)

Post by Alberth »

I talked a user through the process some weeks ago, and made a ticket about it: http://dev.openttdcoop.org/issues/1760

In particular, the IRC log may be useful: http://irclogs.qmsk.net/channels/opentt ... 1289038976

Edit: (Since I don't use or own a Windows machine, not much I can do here.)
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Need help with installing Python (for NMLC)

Post by Hyronymus »

I'll have a look there, thx :).
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Need help with installing Python (for NMLC)

Post by Hyronymus »

Sorry for the double post but I have installed the stuff. But now the command line. Where/how do you run that?
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: Need help with installing Python (for NMLC)

Post by Alberth »

Hyronymus wrote:Sorry for the double post but I have installed the stuff. But now the command line. Where/how do you run that?
I see no problems in this double post, it is a next step in the process.

You have to open a shell (in unix terms), commonly known as 'command' or 'cmd' or so in Windows land.
Simplest way is start->run...->type 'cmd' or 'command' or whatever Windows calls it these days.
It should give you a black(?) window with a "C:\>" like prompt.

Go to the right directory (with "cd" and/or "<drive-letter>:"), and type eg "python nmlc mynmlfile.nml"


Edit: It may be useful to add any new findings to the ticket (If you don't want to make an account there, I can do it for you).
The project is also interested in any manual additions.
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Need help with installing Python (for NMLC)

Post by WWTBAM »

If you mean "python nmlc ..." Command Prompt. Atleast that's how I run olther python scripts I have.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Need help with installing Python (for NMLC)

Post by Hyronymus »

It says: python isn't recognised as an internal or external command, program or batch file.

Running command in cmd.exe from C:\Users\<myname>\Documents\OpenTTD\nml-r1118
Python is installed in C:\Python26 and ply installed in nml-r1118\ply (just the ply directory from the ply-3.3 directory that you download)
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Need help with installing Python (for NMLC)

Post by WWTBAM »

Did you add the path to the python directory to your PATH? If you don't know how, Right click on (My) Computer and click Properties then the Advanced Tab then click Environment Variables and find the one called PATH. If you use Windows Vista or higher you will have to click Advanced system settings before the tabbed dialog appears.
Edit Adding Python to the PATH is mentioned in the IRC logs.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Need help with installing Python (for NMLC)

Post by Hyronymus »

As a system variable or user variable?
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Need help with installing Python (for NMLC)

Post by WWTBAM »

Depends on weather you think it will be useful to any other users on your system or not.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Need help with installing Python (for NMLC)

Post by Hyronymus »

OK, didnt work though :? . Any particular name it should have, I went for Python with C:\Python26 as the path.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: Need help with installing Python (for NMLC)

Post by Alberth »

python.exe should be in the directory that you add.
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Need help with installing Python (for NMLC)

Post by Lakie »

From memory Python associates .py files on Windows.
If you copy "nmlc" and call it "nmlc.py" in the target directory, you can run it from the command line, not hugely clean though. :(
"nmlc.py -l <dir> <file>"

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Need help with installing Python (for NMLC)

Post by Hyronymus »

Lakie wrote:From memory Python associates .py files on Windows.
If you copy "nmlc" and call it "nmlc.py" in the target directory, you can run it from the command line, not hugely clean though. :(
"nmlc.py -l <dir> <file>"

~ Lakie
Thanks Lakie, that got me a lot further. Now it shouts "Default language file lang\english.lng doesn't exist" though.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Need help with installing Python (for NMLC)

Post by planetmaker »

Hyronymus wrote: Thanks Lakie, that got me a lot further. Now it shouts "Default language file lang\english.lng doesn't exist" though.
That's true. But that is part of your newgrf and it's up to you to provide it:
http://hg.openttdcoop.org/nml/raw-file/ ... uage-files
Have a look at existing NML projects on a verbose treatise how it sh/could look like.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Need help with installing Python (for NMLC)

Post by Hyronymus »

OK, I have a language file and it does something. I get no result in-game though, may I request a decompiled townname NML file so I can see how to build-up a town name list?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Need help with installing Python (for NMLC)

Post by planetmaker »

Well, did you check out or look at the other projects http://dev.openttdcoop.org/projects/townnames ?
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: Need help with installing Python (for NMLC)

Post by Alberth »

Hyronymus wrote:OK, I have a language file and it does something. I get no result in-game though, may I request a decompiled townname NML file so I can see how to build-up a town name list?
nmlc can also generate NFO output which may be useful for finding out what it does.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Need help with installing Python (for NMLC)

Post by Hyronymus »

planetmaker wrote:Well, did you check out or look at the other projects http://dev.openttdcoop.org/projects/townnames ?
I did but all I can find is language files that don't contain town names (i.e. Ammler's Swiss Town Names).
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Need help with installing Python (for NMLC)

Post by planetmaker »

Town names don't go into the language files.

You can check out the pre-processed sources of all town name projects on the bundles server which hosts the releases and nightlies; in the log folder there should always be the pre-processed nml and / or nfo respectively. E.g.
http://bundles.openttdcoop.org/belarusi ... ntowns.nml
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 9 guests