I expect my pip requirements file (requirements.txt) to be processed at some point during the build, i.e. to see a pip install -r requirements.txt line, or something similar. I expect this because in my Admin/Advanced Settings page on readthedocs, I set the "Requirements file" field accordingly.
My requirements file is never processed. Consequently, my build fails.
@rgerkin hi! You are using a conda environment, that's why. As far as I know, if you use a conda env, you have to put the pip requirements inside the environment.yml used by conda.
Besides, I saw that you are using readthedocs.yml and I think that setting overrides the _Admin/Advanced Settings_.
I took a look at your settings and I can see that you are using the pip option inside the environment.yml and RTD is installing those packages also in the conda env but I don't really understand why the installation of your module fails trying to install again the packages that were already installed.
I need to keep taking a look, but that is what I have now. Sorry :(
As far as I know, if you use a conda env, you have to put the pip requirements inside the environment.yml used by conda.
I did not manage to get that to work: https://readthedocs.org/projects/fpylll/builds/5289709/
My conda env file looks like
dependencies:
- gmp
- pip:
- Cython
- cysignals
- git+https://github.com/jdemeyer/sphinx
It would be nice to have an actual working example of this.
As far as I know, if you use a conda env, you have to put the pip requirements inside the environment.yml used by conda.
Is there a structural reason why RTD cannot support both a conda env and a requirements.txt? I mean, it could first install the conda env and then run pip install -r requirements.txt within that env.
Running the pip install after the conda env was created and configured shouldn't be a problem at all, I think. Conda support is kind of a new feature in RTD and the core developers don't have too much experience on this topic. So, help on this and a PR with this change would be appreciated for sure.
Here is the relevant code, and looks like there is an explanation about this issue there.
It would work to to put a URL in the pip sub-section of depencencies in the conda env file, except that the RTD built process calls pip install --ignore-installed ... later on. That means it will complain about any pip packages it can't find on PyPI, even though they're already installed in the conda environment!
I wouldn't add another way to install pip requirements in conda if there is already a way to do it, more maintained, contained in the YAML file and it's standard.
Please, if you think that this is a blocker for your project to build on RTD make a new comment of feel free to reopen explaining the situation. Thanks!
https://github.com/rtfd/readthedocs.org/issues/2776#issuecomment-377738855
About that we have https://github.com/rtfd/readthedocs.org/issues/5545
Also reading https://www.anaconda.com/using-pip-in-a-conda-environment/, looks like we shouldn't use pip at all when using conda
Most helpful comment
Running the
pip installafter the conda env was created and configured shouldn't be a problem at all, I think. Conda support is kind of a new feature in RTD and the core developers don't have too much experience on this topic. So, help on this and a PR with this change would be appreciated for sure.