OCHA-DAP / hdx-python-api

Python API for interacting with the HDX Data Portal
http://data.humdata.org
MIT License
80 stars 16 forks source link

Required python3 while installing hdx-python-api==4.3.0 #32

Closed hemant-softvan closed 2 years ago

hemant-softvan commented 2 years ago

This is working till now, suddenly I installed this on my same version OS and same version python2.7. Stop working

Collecting libhxl>=4.24.1 Downloading libhxl-4.24.1.tar.gz (91 kB) ERROR: Command errored out with exit status 1: command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9T48_N/libhxl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9T48_N/libhxl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-Avj4GK cwd: /tmp/pip-install-9T48_N/libhxl/ Complete output (5 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-9T48_N/libhxl/setup.py", line 7, in <module> raise RuntimeError("libhxl requires Python 3 or higher") RuntimeError: libhxl requires Python 3 or higher ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. WARNING: You are using pip version 20.3.3; however, version 20.3.4 is available. You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.

Our old application build on python2. Please help me to fix this. Thanks

mcarans commented 2 years ago

You will need to pin the libhxl dependency to 4.5.1. Please let me know if that works: it may be that pinning of other dependencies is required.

mcarans commented 2 years ago

@hemant-softvan You can try adding to your requirements.txt: hdx-python-utilities==2.7.3 hdx-python-country==2.9.9

If you do the above, you will not need to pin libhxl (as that is already pinned in hdx-python-country 2.9.9). The versions above are the last versions of those two libraries that support Python 2. Please let me know if this works.

mcarans commented 2 years ago

I haven't heard back from you. I will close this issue. Please reopen if you need further assistance.