Skip to content
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

Support pip install inside conda environment #2776

Closed
rgerkin opened this issue Apr 3, 2017 · 9 comments
Closed

Support pip install inside conda environment #2776

rgerkin opened this issue Apr 3, 2017 · 9 comments
Labels
Improvement Minor improvement to code Needed: design decision A core team decision is required

Comments

@rgerkin
Copy link

rgerkin commented Apr 3, 2017

Details

Expected Result

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.

Actual Result

My requirements file is never processed. Consequently, my build fails.

@humitos
Copy link
Member

humitos commented Apr 13, 2017

@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 :(

@jdemeyer
Copy link

jdemeyer commented Apr 14, 2017

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.

@jdemeyer
Copy link

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.

@humitos
Copy link
Member

humitos commented Apr 18, 2017

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.

@humitos humitos added Improvement Minor improvement to code Needed: design decision A core team decision is required Needed: more information A reply from issue author is required labels Apr 24, 2017
@agjohnson agjohnson removed the Needed: more information A reply from issue author is required label Mar 30, 2018
@agjohnson agjohnson changed the title pip requirements file not being processsed Support pip install inside conda environment Mar 30, 2018
@stsewd
Copy link
Member

stsewd commented Mar 31, 2018

Here is the relevant code, and looks like there is an explanation about this issue there.

https://github.com/rtfd/readthedocs.org/blob/393e31ad3a9aafee297df64f1a654ffcda7ef04a/readthedocs/doc_builder/python_environments.py#L369-L372

@goerz
Copy link

goerz commented Apr 1, 2018

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!

@humitos
Copy link
Member

humitos commented Apr 28, 2019

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!

@humitos humitos closed this as completed Apr 28, 2019
@stsewd
Copy link
Member

stsewd commented Apr 29, 2019

#2776 (comment)

About that we have #5545

@stsewd
Copy link
Member

stsewd commented Apr 29, 2019

Also reading https://www.anaconda.com/using-pip-in-a-conda-environment/, looks like we shouldn't use pip at all when using conda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

6 participants