cityjson / cjio

CityJSON/io: Python CLI to process and manipulate CityJSON files
MIT License
126 stars 32 forks source link

CityJSON to OBJ fails under Python 3.11.0 #161

Closed paulojraposo closed 1 year ago

paulojraposo commented 1 year ago

Thanks for this software!

Ubuntu Linux 22.04 here. It seems to work just fine under a Python 3.9.16 conda environment on my machine, but in one running 3.11.0 I get this:

$ python --version
Python 3.11.0
$ cjio /home/paulo/Downloads/CityJSON_Tutorial/twobuildings.city.json export obj /home/paulo/Downloads/CityJSON_Tutorial/twobuildings.obj 
Traceback (most recent call last):
  File "/home/paulo/anaconda3/envs/CityJSON/bin/cjio", line 5, in <module>
    from cjio.cjio import cli
  File "/home/paulo/anaconda3/envs/CityJSON/lib/python3.11/site-packages/cjio/cjio.py", line 55, in <module>
    @cli.resultcallback()
     ^^^^^^^^^^^^^^^^^^
AttributeError: 'Group' object has no attribute 'resultcallback'. Did you mean: 'result_callback'?
$ cjio --version
Traceback (most recent call last):
  File "/home/paulo/anaconda3/envs/CityJSON/bin/cjio", line 5, in <module>
    from cjio.cjio import cli
  File "/home/paulo/anaconda3/envs/CityJSON/lib/python3.11/site-packages/cjio/cjio.py", line 55, in <module>
    @cli.resultcallback()
     ^^^^^^^^^^^^^^^^^^
AttributeError: 'Group' object has no attribute 'resultcallback'. Did you mean: 'result_callback'?
hugoledoux commented 1 year ago

I think your cjio is old, this was fixed in d2f1732d3f1284b4f80cc6ca87f92d248a6b4e6e

If you install the latest version it should work, and intall the lastest of Click too (https://click.palletsprojects.com/en/8.1.x/)

paulojraposo commented 1 year ago

Could be; conda list on both environments tells me the failing one has cjio 0.6.10 on Python 3.11.0, while the working one has cjio 0.7.5 on Python 3.9.16; both have click 8.1.3. In both cases I made a conda environment, then used pip to install cjio.