0

mappython3でtmx形式でエクスポート・保存できるライブラリを探しています。私が見つけた:

PyTMXしかし、ドキュメントは言う

最後に、保存機能はありません。マップがロードされたら、マップへの変更を保存する方法を提供するのはあなた次第です。pickle モジュールを使用して、良い結果を得ました。

ドキュメントが言うtmxlib

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 をインストールする方法を知っていますか?

4

2 に答える 2

0

利用可能なその他の tmx ライブラリ: http://pythonhosted.org/tmx/ ( https://pypi.python.org/pypi/tmx。これにより、読み込みと保存が可能です。

于 2015-05-23T12:15:13.180 に答える
0

pipを使用してpython3で同じライブラリを今すぐインストールしました。pip install が機能しない場合:

  1. https://pypi.python.org/pypi/tmxlib/0.2.1から zip パッケージをダウンロードします。
  2. 上記のパッケージを解凍します。
  3. 解凍したディレクトリにはスクリプト「setup.py」があります
  4. コマンドを指定して、ターミナル経由でこのスクリプトを実行します

    python setup.py インストール

うまくいけばうまくいくでしょう。また、ライブラリは問題ないと思います.代わりに、あなたのバージョンのpipにバグがあるかもしれません.

于 2015-05-23T12:10:21.063 に答える