Mindwerks / worldengine

World generator using simulation of plates, rain shadow, erosion, etc.
MIT License
987 stars 128 forks source link

Latest Build Runtime Error #115

Open esampson opened 8 years ago

esampson commented 8 years ago

I've had this error both with an absolutely clean Cygwin install (the only options turned on were python-2.7, setuptools, can gcc) and with Ubuntu (I didn't do an absolutely clean Ubuntu build since it is the identical error)

After copying the source code of the latest build to the clean environment I run python setup.py build and python setup.py install (or sudo python setup.py install in Ubuntu). It installs fine but when I run the command "worldengine" I get the following error:

Traceback (most recent call last): File "/usr/bin/worldengine", line 9, in load_entry_point('worldengine==0.18.0', 'console_scripts', 'worldengine')() File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 552, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2672, in load_entry_point return ep.load() File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2345, in load return self.resolve() File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2351, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/usr/lib/python2.7/site-packages/worldengine-0.18.0-py2.7.egg/worldengine/cli/main.py", line 12, in from worldengine.imex import export ImportError: No module named imex

psi29a commented 8 years ago

Does this file exist?

worldengine/imex/__init__.py

Do remember that the master branch is development... not a release, so we've not tested actually making a package/installing it.

If you want to run/develop worldengine, just git clone the repo, create a virtualenv, source venv/bin/activate and then: python worldengine

esampson commented 8 years ago

Yes, the file does exist. I should also note that if I go to cli/main.py and edit out the line "from worldengine.imex import export" everything runs fine. Apparently the latest code wants to import the functions but then it never seems to use them.

psi29a commented 8 years ago

The latest code works for me and uses what is imported, I make a point to make sure that we never import methods that are never used. I wonder if it either something to do with your environment. To be honest, I've not tried to 'python setup.py install' maybe that is it?

Have you tried creating a virtualenv and running the code in place without installing it?

Try running the CLI with the export params, and you'll have a crash telling you calling an unknown method... likely the ones you commented out.

esampson commented 8 years ago

That is possibly it. I am running it from the install. Can you give me an example CLI command for me to test?

psi29a commented 8 years ago
virtualenv venv
source venv/bin/activate
pip install -r requirements2.txt
python worldengine

This can be found in our README.md: https://github.com/Mindwerks/worldengine#install-dependencies

esampson commented 8 years ago

Ok. Completely clean install on Cygwin with Python, GCC, and Setuptools. Setuptools was then used to install pip and virtualenv. Created and switched to virtualenvironment venv, ran the pip install.

$ pip install -r requirements2.txt
Collecting Pillow==2.8.2 (from -r requirements_base.txt (line 1))
  Downloading Pillow-2.8.2.tar.gz (9.1MB)
    100% |████████████████████████████████| 9.1MB 13kB/s
Collecting PyPlatec==1.3.1.post1 (from -r requirements_base.txt (line 2))
  Downloading PyPlatec-1.3.1.post1.tar.gz (49kB)
    100% |████████████████████████████████| 53kB 797kB/s
Collecting argparse==1.2.1 (from -r requirements_base.txt (line 3))
  Downloading argparse-1.2.1.tar.gz (69kB)
    100% |████████████████████████████████| 69kB 499kB/s
Collecting noise==1.2.2 (from -r requirements_base.txt (line 4))
  Downloading noise-1.2.2.tar.gz (125kB)
    100% |████████████████████████████████| 126kB 323kB/s
Collecting nose==1.3.7 (from -r requirements_base.txt (line 5))
  Downloading nose-1.3.7-py2-none-any.whl (154kB)
    100% |████████████████████████████████| 155kB 341kB/s
Collecting numpy==1.9.2 (from -r requirements_base.txt (line 6))
  Downloading numpy-1.9.2.tar.gz (4.0MB)
    100% |████████████████████████████████| 4.0MB 28kB/s
Collecting protobuf==2.6.0 (from -r requirements2.txt (line 2))
  Downloading protobuf-2.6.0.tar.gz (187kB)
    100% |████████████████████████████████| 188kB 374kB/s
Requirement already satisfied (use --upgrade to upgrade): setuptools in ./venv/lib/python2.7/site-packages (from protobuf==2.6.0->-r requirements2.txt (line 2))
Building wheels for collected packages: Pillow, PyPlatec, argparse, noise, numpy, protobuf
  Running setup.py bdist_wheel for Pillow
  Stored in directory: /home/Evan/.cache/pip/wheels/65/02/18/d834f46f2bf1562380e5be37a8ad2b60f4ec7ce686073449f3
  Running setup.py bdist_wheel for PyPlatec
  Stored in directory: /home/Evan/.cache/pip/wheels/30/6a/ff/ce4b0ca60c971d086b39e733905c3e753def3bb3d65097c8c5
  Running setup.py bdist_wheel for argparse
  Stored in directory: /home/Evan/.cache/pip/wheels/b1/ff/41/cc59bc0401a52d967b6301df8916133daacee6437a57b1d5df
  Running setup.py bdist_wheel for noise
  Stored in directory: /home/Evan/.cache/pip/wheels/a7/a2/c9/235a1e89942d1e8c600f1fea1cc321e9fc8fe8087703c94acf
  Running setup.py bdist_wheel for numpy
  Stored in directory: /home/Evan/.cache/pip/wheels/4b/cb/75/2cf74e8d40c2f6e466c621d598769f961bbb0feac948013dfb
  Running setup.py bdist_wheel for protobuf
  Stored in directory: /home/Evan/.cache/pip/wheels/27/a0/76/a1ed46e3ab5c22ded2423921188f45656ff5ed85dc76a93e98
Successfully built Pillow PyPlatec argparse noise numpy protobuf
Installing collected packages: Pillow, PyPlatec, argparse, noise, nose, numpy, protobuf
Successfully installed Pillow-2.8.2 PyPlatec-1.3.1.post1 argparse-1.2.1 noise-1.2.2 nose-1.3.7 numpy-1.9.2 protobuf-2.6.0
(venv)

Then I ran the worldengine command:

$ python worldengine
Unable to load GDAL support, no heightmap export possible.
Worldengine - a world generator (v. 0.18.0)
-----------------------
 operation         : world generation
 seed                 : 22019
 name                 : seed_22019
 width                : 512
 height               : 512
 number of plates     : 10
 world format         : pickle
 black and white maps : False
 step                 : full
 greyscale heightmap  : False
 rivers map           : False

starting (it could take a few minutes) ...

Producing ouput:
* world data saved in './seed_22019.world'
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
  File "/home/Evan/worldengine-master/worldengine/__main__.py", line 6, in <module>
main.main()
  File "worldengine/cli/main.py", line 449, in main
args.verbose, black_and_white=args.black_and_white)
  File "worldengine/cli/main.py", line 47, in generate_world
draw_ocean_on_file(w.ocean, filename)
  File "/home/Evan/worldengine-master/worldengine/../worldengine/draw.py", line 414, in draw_ocean_on_file
    img.complete()
  File "/home/Evan/worldengine-master/worldengine/../worldengine/draw.py", line 146, in complete
self.img.save(self.filename)
  File "/home/Evan/worldengine-master/venv/lib/python2.7/site-packages/PIL/Image.py", line 1693, in save
    save_handler(self, fp, filename)
  File "/home/Evan/worldengine-master/venv/lib/python2.7/site-packages/PIL/PngImagePlugin.py", line 757, in _save
    [("zip", (0, 0)+im.size, 0, rawmode)])
  File "/home/Evan/worldengine-master/venv/lib/python2.7/site-packages/PIL/ImageFile.py", line 476, in _save
    e = Image._getencoder(im.mode, e, a, im.encoderconfig)
  File "/home/Evan/worldengine-master/venv/lib/python2.7/site-packages/PIL/Image.py", line 436, in _getencoder
    raise IOError("encoder %s not available" % encoder_name)
IOError: encoder zip not available
esampson commented 8 years ago

Didn't mean to close the issue. Wrong button.

psi29a commented 8 years ago

https://stackoverflow.com/questions/3544155/about-the-pil-error-ioerror-decoder-zip-not-available

Looks like zlib isn't available in your cygwin environment.

I'm going to go out on a limb here and ask why you are using Cygwin instead of native windows python. I've not tested on cygwin and I hope to avoid doing so. ;)

I wrote the procedure you can follow here: https://github.com/Mindwerks/worldengine#windows

tcld commented 8 years ago

I just want to add that I stumbled upon the missing imex-module, too. As far as I can tell it might be because the imex-folder is empty and lacking the file export.py that is supposed to be imported. Where is export.py? It is not part of the master-branch.

https://github.com/Mindwerks/worldengine/tree/master/worldengine/imex

EDIT: The last release (0.18) didn't have that folder yet: https://github.com/Mindwerks/worldengine/tree/v0.18.0/worldengine

psi29a commented 8 years ago

There is no export.py, everything in inside

worldengine/imex/__init__.py

which is intentional. This is something I'll look into later, but for now it works as-is when using virtualenv which currently the only supported method of use.