I am running Python 3.9 in Azure Functions and am trying to install pycocotools from Github using this line in my requirements.txt:
git+https://github.com/gautamchitnis/cocoapi.git@cocodataset-master#egg=pycocotools&subdirectory=PythonAPI
It fails during install with following message:
16:15:14 SunshaineFA: [14:15:06+0000] Collecting pycocotools
16:15:14 SunshaineFA: [14:15:06+0000] Cloning https://github.com/gautamchitnis/cocoapi.git (to revision cocodataset-master) to /tmp/pip-install-dseyxp2g/pycocotools
16:15:14 SunshaineFA: ERROR: Command errored out with exit status 1:
16:15:14 SunshaineFA: command: /tmp/oryx/platforms/python/3.9.7/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dseyxp2g/pycocotools/PythonAPI/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dseyxp2g/pycocotools/PythonAPI/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r
16:15:14 SunshaineFA: '"'"', '"'"'
16:15:14 SunshaineFA: '"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-10ky3zhs
16:15:14 SunshaineFA: cwd: /tmp/pip-install-dseyxp2g/pycocotools/PythonAPI
16:15:14 SunshaineFA: Complete output (5 lines):
16:15:14 SunshaineFA: Traceback (most recent call last):
16:15:14 SunshaineFA: File "<string>", line 1, in <module>
16:15:14 SunshaineFA: File "/tmp/pip-install-dseyxp2g/pycocotools/PythonAPI/setup.py", line 2, in <module>
16:15:14 SunshaineFA: from Cython.Build import cythonize
16:15:14 SunshaineFA: ModuleNotFoundError: No module named 'Cython'
16:15:14 SunshaineFA: ----------------------------------------
16:15:14 SunshaineFA: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
16:15:14 SunshaineFA: WARNING: You are using pip version 20.2.3; however, version 22.2.2 is available.
Saying, Cython is not found. But earlier in my requirements.txt I am installing Cython using Cython==0.29.30
In the logs i can even see, Cython is getting installed:
16:15:12 SunshaineFA: [14:13:52+0000] Collecting Cython==0.29.30
16:15:13 SunshaineFA: [14:13:52+0000] Using cached Cython-0.29.30-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (2.0 MB)
Why am I still getting the error message saying Cython is not found? Is there any way to fix this? Can i maybe somehow install those 2 packages manually after the function is running?