-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't build autofunction because unable to install a dependency (GDAL) listed in requirements.txt #8365
Comments
Hello @PratyushTripathy ! https://pypi.org/project/GDAL/ does not seem to provide precompiled Python wheels for any platform. This means that, to install it, you will also need
To fix this issue, you can add However, I notice that you're specifying
Let us know about your progress, happy to help. |
Hi @astrojuanlu, Thank you for your prompt response. My package does not really rely on new functionalities of GDAL so I think v2.2.3 should just work fine. Thanks for pointing that out. I specified the version in the Btw, the Sorry if I am doing something silly, I am new to docs. |
No need to apologize @PratyushTripathy :) You are not alone: https://gis.stackexchange.com/a/74060/99665 The problem is that, apparently, to fix the missing Therefore, my recommendation is two switch to conda, as explained in https://docs.readthedocs.io/en/stable/guides/conda.html |
Sorry, I was mistaken @PratyushTripathy : you can set custom environment variables on https://readthedocs.org/dashboard/pyrsgis/environmentvariables/. |
It worked!! I have been thinking about this for a while now. Had almost reached a point where I felt that this can not be solved and I have to let go the temptation. You re-motivated me to build a good documentation. :) Thank you so much! |
Glad to hear! 🎉 Could you please write here what environment variables did you add to your UI, for future reference? |
I created two variables and did not check the Name: Name: |
Perfect! You might want to expose them in PR builds if you are accepting external contributions. Otherwise, installation will fail for PRs. Closing. |
Hi @astrojuanlu, This was working fine until today when the build failed. It says Is there a change in the GDAL version that you use in the base image? I built the documentation offline on my PC and it seems to be working fine. |
According to OSGeo/gdal#4467, you'll have to pin setuptools |
I tried to pin setuptools, tried several older versions one by one (57.5.0, 57.4.0 and so on), none worked. Then I pinned it to the version that I have in PC (47.1.0 - it is quite old though) because the build is working fine on my PC, but that didn't work either. By the way, I am adding this only in the docs_requirements.txt file, hope that is okay? |
@PratyushTripathy for that to work, you'll need to have a separate requirements file with that dependency, and put it just above the one you have https://github.com/PratyushTripathy/pyrsgis/blob/8938fc3431d944c54bd3484f1132d047b30f1c5b/.readthedocs.yaml#L24-L25, that way rtd will first install that version of setuptools and then install the other requirements using that version of setuptools, otherwise it will keep installing all the requirements with the latest version of setuptools. Making it a two-step installation is needed to make it work. |
@stsewd It worked. Thank you! Here is the updated .readthedocs.yaml file. |
Hi @stsewd @astrojuanlu, just wanted to check if there is a change in setting up GDAL that readthedocs uses in the backend. The recent pyrsgis build failed. I have only committed this change since the last successful build and this commit doesn't look problematic to me. |
Hi @PratyushTripathy , this has nothing to do with how RTD sets up GDAL:
But then, there's also this...
😳 Please consider raising this to GDAL, pip, or setuptools. |
Removed the part that specified the setuptools version. Now the error is about the GDAL version. Tried a few other things related to specifying the GDAL version in the requirements.txt, that didn't work either. |
@PratyushTripathy I think you're back to the initial error: old gdal is incompatible with newer setuptools. If you keep experiencing the setuptools installation errors, you should report them to pip or setuptools. Read the Docs uses the latest pip. There is not much else we can do for you, sorry. |
@astrojuanlu No worries. Thank you for the information. Will report the issue to pip/setuptools. |
Details
I am trying to build documentation for my python package, which depends on another module "GDAL". When I list this in the requirements.txt, the build fails, without listing GDAL, the build passes. The problem really is that I can not use autofunction and linkcode if my module is not correctly installed in the virtual environment.
when I add GDAL in the requirements.txt: https://readthedocs.org/projects/pyrsgis/builds/14320709/
when I remove GDAL from requirements.txt: https://readthedocs.org/projects/pyrsgis/builds/14320681/
Expected Result
I eventually want to build documentation such that my module's API pages on readthedocs can link to the source code. I do not really care if GDAL is installed in the virtual environment or not. Basically I want to know:
Actual Result
linkcode does not work because the module can not be imported because it is unable to install GDAL in the backend. On my local machine I am able to successfully build it because GDAL is installed--autofunction works on my PC build.
The text was updated successfully, but these errors were encountered: