-
-
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
Unclean package installation when virtualenv option is enabled #4968
Comments
Can you try wiping the environment before build? |
I was looking for an option like that under the admin part of the control panel, but since it wasn't there, I assumed it clears it every run. Now I'm getting new issues which do not occur locally, but I'm not sure yet why they occur (https://readthedocs.org/projects/fplore/builds/8213711/) Edit: I think I've figured out the origin of the new build failure. I use sphinx-gallery, which is in my docs/requirements.txt. The How would I fix this elegantly? Adding matplotlib with an explicit version string to docs/requirements.txt wouldn't qualify, since this would add redundant information that's already present in my setup.py. Edit 2: And then rerunning the build without clearing the cache gives the initial errors from this issue again (https://readthedocs.org/projects/fplore/builds/8215731/). So this does not fix it. Edit 3: I also cannot reproduce this locally. My attempt was to first run |
I've created a minimum failing example based on matplotlib. To get it to fail, I had enable the following non-standard options in RTD:
My dirty workaround also succeeds (explicitly specifying I presume the following is happening: the
Edit: This erroneous import behavious is caused by enabling the virtualenv option on readthedocs. So in essence, RTD does not properly isolate virtualenv packages. When the option is disabled, project dependencies successfully overwrite previously installed dependencies. When the option is enabled, they are installed side by side. Edit 2: |
@stsewd I believe this would qualify as a bug, not a support request. I've cleanly circumvented this bug for now by moving away from readthedocs online configuration to the config file, using pip instead of setup.py install, and forgoing docs/requirements.txt for extras_require in my setup.py. Then the dependency resolution is done as a whole. .readthedocs.yml:
|
Do you mean the install option? I'm guessing some residuals from the previous installation (if I understand correctly you change the versions, right?). If so, you should only need to wipe the environment to resolve that, we can't do that automatically because we don't know what packages are going to be installed, if we cache the virtualenv installation to save resources. |
Yes, the option " Install your project inside a virtualenv using setup.py install". No, this has nothing to do with residuals from a previous installation/build of rtd. It installs two different versions at the same time when you have a cleanly wiped environment (due to different installation methods). I gave you a minimum failing example here: https://github.com/mueslo/rtd_min_fail/tree/6f3c33990bf3e1b7e4c0e66b477fd344561e7761 I've already explained it above, but for your convenience, here it is again. docs/requirements.txt leads to matplotlib 3.0.2 being installed. setup.py leads to matplotlib 2.2.3 being installed alongside it. Import matplotlib imports matplotlib version 2.2.3. When matplotlib tries to import other parts of matplotlib, it apparently imports the 3.0.2 version. |
I believe this is a sphinx-galery issue, when the package is installed in rtd they install an additional package https://github.com/sphinx-gallery/sphinx-gallery/blob/29d317b1674a08fc36a4e2ad35e183cdce8f1e39/setup.py#L20-L22, that package has a different version of matplolib https://github.com/mwaskom/seaborn/blob/f0349b1a7f1e022cb1da8b94f2e019f04eeed397/setup.py#L35, I'll try to replicate this locally setting a env variable, but not sure what we can do here. |
Sure, that's the cause, but it shouldn't be an issue if implemented correctly, as they do not fix a version requirement for matplotlib. My approach to fixing this would be to first get all the requirements from setup.py, requirements, etc., evaluate them as a whole, and then try to install them in one coherent way. But I'm unsure how feasible that is. |
I don't think that's possible or something we would implement. I have a question, this problem would go away if we change the installation order? Like first calling setup.py and then installing from requeriments.txt? If so, we have that coming in our v2 config file :) #4740 |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. Thanks! |
Details
Expected Result
Documentation builds fine as it did previously and as it does locally.
Actual Result
Build errors.
and sometimes
The text was updated successfully, but these errors were encountered: