0

I search a lib who can export/save map in tmx format with python3. I found:

PyTMX but, doc says:

Finally, there is no save feature. Once the map is loaded, it will be up to you to provide a way to save changes to the map. I've used the pickle module with good results.

tmxlib where doc says:

Saving is equally easy:

>>> map.save('saved.tmx')
>>> map_as_string = map.dump()

But pip installation fail (python3):

pip install tmxlib
Downloading/unpacking tmxlib
  Downloading tmxlib-0.2.1.tar.gz
  Running setup.py (path:/home/bux/.virtualenvs/testsynergine2/build/tmxlib/setup.py) egg_info for package tmxlib

    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/home/bux/.virtualenvs/testsynergine2/build/tmxlib/setup.py", line 59, in <module>
        import tmxlib
      File "/home/bux/.virtualenvs/testsynergine2/build/tmxlib/tmxlib/__init__.py", line 9, in <module>
        from tmxlib.map import Map
      File "/home/bux/.virtualenvs/testsynergine2/build/tmxlib/tmxlib/map.py", line 5, in <module>
        from tmxlib import helpers, fileio, tileset, layer
      File "/home/bux/.virtualenvs/testsynergine2/build/tmxlib/tmxlib/tileset.py", line 8, in <module>
        from tmxlib import helpers, fileio, tile, image, terrain
      File "/home/bux/.virtualenvs/testsynergine2/build/tmxlib/tmxlib/image.py", line 28, in <module>
        preferred_image_class = image_classes[0]
    IndexError: list index out of range
    Complete output from command python setup.py egg_info:
    running egg_info

creating pip-egg-info/tmxlib.egg-info

writing top-level names to pip-egg-info/tmxlib.egg-info/top_level.txt

writing requirements to pip-egg-info/tmxlib.egg-info/requires.txt

writing dependency_links to pip-egg-info/tmxlib.egg-info/dependency_links.txt

writing pip-egg-info/tmxlib.egg-info/PKG-INFO

writing manifest file 'pip-egg-info/tmxlib.egg-info/SOURCES.txt'

warning: manifest_maker: standard file '-c' not found



reading manifest file 'pip-egg-info/tmxlib.egg-info/SOURCES.txt'

writing manifest file 'pip-egg-info/tmxlib.egg-info/SOURCES.txt'

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/home/bux/.virtualenvs/testsynergine2/build/tmxlib/setup.py", line 59, in <module>

    import tmxlib

  File "/home/bux/.virtualenvs/testsynergine2/build/tmxlib/tmxlib/__init__.py", line 9, in <module>

    from tmxlib.map import Map

  File "/home/bux/.virtualenvs/testsynergine2/build/tmxlib/tmxlib/map.py", line 5, in <module>

    from tmxlib import helpers, fileio, tileset, layer

  File "/home/bux/.virtualenvs/testsynergine2/build/tmxlib/tmxlib/tileset.py", line 8, in <module>

    from tmxlib import helpers, fileio, tile, image, terrain

  File "/home/bux/.virtualenvs/testsynergine2/build/tmxlib/tmxlib/image.py", line 28, in <module>

    preferred_image_class = image_classes[0]

IndexError: list index out of range

----------------------------------------
Cleaning up...

Do you know tmx libraries can do that, or a way to install tmxlib ?

bux
  • 7,087
  • 11
  • 45
  • 86
  • `IndexError: list index out of range` Sounds like a problem in the library itself. I would recommend filing an issue in the library's bug tracker. – thefourtheye May 23 '15 at 09:47
  • Good idea. But i don't found athor email or tracker for this project. Do you ? – bux May 23 '15 at 12:05

2 Answers2

0

I have installed the same library right now with python3 successfully using pip. If pip install is not working for you then:

  1. Download the zip package from https://pypi.python.org/pypi/tmxlib/0.2.1
  2. Extract the above package.
  3. In the extracted directory there is a script "setup.py"
  4. Run this script via terminal by giving command

    python setup.py install

It will work hopefully. Also I think the library is fine..may be there is a bug in your version of pip instead.

zkk
  • 207
  • 1
  • 8
0

Available other tmx lib: http://pythonhosted.org/tmx/ (https://pypi.python.org/pypi/tmx . This can load and save.

bux
  • 7,087
  • 11
  • 45
  • 86