2015-05-23 30 views
0

我搜索一個lib可以導出/保存map tmx格式與python3。我發現:搜索tmx庫可以導出/保存地圖

PyTMX但是,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其中doc says

Saving is equally easy: 

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

但是PIP安裝失敗(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... 

你知道TMX庫可以做到這一點,或一種方式來插入高大的tmxlib?

+0

'IndexError:。列表索引range'像在圖書館本身就是一個問題聽起來我會建議在圖書館的bug提交的問題跟蹤器 – thefourtheye

+0

好主意,但是我沒有找到這個項目的athor電子郵件或跟蹤器,是嗎? – bux

回答

0

我已經用python3成功地使用pip現在安裝了相同的庫。如果PIP安裝工作不適合你,那麼:

  1. https://pypi.python.org/pypi/tmxlib/0.2.1
  2. 下載的壓縮包解壓以上套餐。
  3. 在解壓縮目錄下有一個腳本「setup.py」
  4. 運行通過終端這一腳本通過給命令

    蟒蛇的setup.py安裝

它有望合作。此外,我認爲圖書館是好的..可能是你的pip版本中存在一個錯誤。