NML - Large sets: one vehicle per file?

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

Moderator: Graphics Moderators

audigex
Tycoon
Tycoon
Posts: 2056
Joined: 09 Dec 2007 21:28
Contact:

Re: NML - Large sets: one vehicle per file?

Post by audigex »

So I tried adding pil as well as pillow using the following

Code: Select all

sudo pip install pil --allow-external pil --allow-unverified pil
And it works!

So to note my procedure in case anyone comes across similar issues, I think this was the way I got it working:

1) Install python
2) Install pip using easy_install

Code: Select all

sudo easy_install pip
3) Instally ply using easy_install

Code: Select all

sudo easy_install ply
4) Install the development tools

Code: Select all

xcode-select --install
5) Install pil AND pillow

Code: Select all

sudo pip install pil --allow-external pil --allow-unverified pil

Code: Select all

sudo pip install pillow
6) Install nmlc

Code: Select all

sudo pip install nmlc
Thanks for the help planetmaker - especially with my not-exactly-clear explanations of the issues/errors :p
Jon
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: NML - Large sets: one vehicle per file?

Post by Eddi »

it clearly says you're missing some header file. so you did not install all required libraries.
User avatar
Simons Mith
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 14 Jan 2010 23:45

Re: NML - Large sets: one vehicle per file?

Post by Simons Mith »

Installing PIL and Pillow may come back to bite you. Pillow is just an alternative setup of PIL, so you now have two copies of essentially the same thing. (There's even a 'PIL' directory /inside/ pillow.) When I was investigating the same problem, I came across several Pillow devs worrying online about how having both PIL and Pillow was going to result in some people installing both, having it appear to work, then have it all break horribly later. They were against this. :-)
audigex
Tycoon
Tycoon
Posts: 2056
Joined: 09 Dec 2007 21:28
Contact:

Re: NML - Large sets: one vehicle per file?

Post by audigex »

Eddi wrote:it clearly says you're missing some header file. so you did not install all required libraries.
It clearly says it, but I didn't clearly understand it ;-) we in the open source word sometimes forget that not everybody is familiar with the same things as we are. I'm reasonably technical, but I don't generally use python or need to install libraries for my coding work, so they aren't things I look out for when following instructions

The article says that
pip
If you are familiar with python and pip then you can just use
pip install nml
This will install the required dependancies.
That nml install worked first time, so I assumed that it would have installed the required dependencies. Once I got errors it became clear that this wasn't the case so I had to look into installing them separately.

I got to the bottom of it, as you can see above - but it definitely didn't work after installing pillow successfully, and did after installing pil. I don't know how/why that worked like that, I'll play around later seeing if I can reproduce it.
Jon
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: NML - Large sets: one vehicle per file?

Post by Alberth »

audigex wrote:but it definitely didn't work after installing pillow successfully, and did after installing pil. I don't know how/why that worked like that, I'll play around later seeing if I can reproduce it.
What nmlc version are you using?
nml r2113 ( http://dev.openttdcoop.org/projects/nml ... de26b64471 ) changed the "import Image" line to also try "from PIL import Image", which is the recommended form to use for Pillow.
audigex
Tycoon
Tycoon
Posts: 2056
Joined: 09 Dec 2007 21:28
Contact:

Re: NML - Large sets: one vehicle per file?

Post by audigex »

The first attempt was using the hg repository
hg clone http://hg.openttdcoop.org/nml nml

The second attempt using whatever version pip pulls

I don't think I tried the hg version once I'd installed pil+pillow+ply
Jon
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NML - Large sets: one vehicle per file?

Post by planetmaker »

audigex wrote:The first attempt was using the hg repository
hg clone http://hg.openttdcoop.org/nml nml

The second attempt using whatever version pip pulls

I don't think I tried the hg version once I'd installed pil+pillow+ply
I'm pretty sure you want to use 0.3.0 or a newer nightly. I'm not sure what pip will install. And nmlc --version would tell you.

Anyhow, if it works for you now, it will be easy to use the version from the hg repository. Just add that to your path. Using it that way makes it very easy to update.
audigex
Tycoon
Tycoon
Posts: 2056
Joined: 09 Dec 2007 21:28
Contact:

Re: NML - Large sets: one vehicle per file?

Post by audigex »

I'm now running:

0.3.0.r5161:86932569ca7d from 2014-02-17
Library versions encountered:
PIL: 1.1.7
PLY: 3.4

I removed nml with pip, cloned it into ~/nml, ran

Code: Select all

sudo python setup.py install
and added /Users/jon/nml to the path using ~/.profile (which OSX apparently does look for, even if it's not created, which confused me)

[code]export PATH=/Users/jon/nml:$PATH
Perfect :)

I have to run nmlc with sudo, and it complains about
not trusting file /Users/jon/nml/.hg/hgrc from untrusted user jon, group staff
Which presumably is a users/permissions thing, but it seems to compile the grf anyway. Or at least, it creates the file - I've not got anything exciting in it yet, so I can't test if it's working properly
Jon
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: NML - Large sets: one vehicle per file?

Post by Eddi »

you should probably solve that permission issue... don't run programs as root when there's no reason for it.
audigex
Tycoon
Tycoon
Posts: 2056
Joined: 09 Dec 2007 21:28
Contact:

Re: NML - Large sets: one vehicle per file?

Post by audigex »

It's only a dev box for open source and hobby stuff - if someone wants to steal the contents of some github public repositories then they can go ahead

On the other hand I have solved it - the install created a file parsetab.py, which was owned by root, in the nml folder... I've changed the owner to me and it works perfectly
Jon
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 12 guests