-
Notifications
You must be signed in to change notification settings - Fork 998
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
Add a note to installation docs about dependencies #744
Conversation
docs/sphinx/source/installation.rst
Outdated
If you run into an error such as | ||
`ModuleNotFoundError: No module named 'netCDF4'` | ||
you can either add these manually with: | ||
`pip install netCDF4` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR. I'm concerned that users may also be using conda instead of or in addition to pip. What are the repercussions for a conda user if they read this and run pip install netCDF4, or put another way, should they take a different action?
- There is an older version of netcdf4 on anaconda default channel, which still meets pvlib minimum requirments
- WARNING there is also a conda-forge version of the current netcdf4 however, the netcdf4 conda-forge feedstock lists numpy as a dependent, so mixing with the default anaconda channel may corrupt your conda env, therefore probably better to use an env with conda-forge as default
- the netCDF4
setup.py
listsnumpy
andcftime
as dependencies, so usingpip install netcdf4
will installcftime
from PyPI not anaconda. I am assuming that the wheels at the Cheeseshop already include the hdf5 and netcdf4 libraries, which are also available from the anaconda main channel.
So my recommendation would be to treat LIKE ALIKE.
- if PyPI then use
pip
- if anaconda, then use
conda
- if conda-forge, then use
conda -c conda-forge
Where this breaks down is for a few packages like siphon which AFAIK doesn't have a good version on the default anaconda channel. Search anaconda for siphon and you find conda-forge, Unidata, and a few others, each with different versions. Siphon setup.py
lists numpy
, protobuf
, beautifulsoup4
, requests
, and pandas
as dependencies, which are all available from the default anaconda channel or conda-forge. If they are installed first using conda, then siphon can be installed from PyPI using pip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I didn't read the comments in the installation instructions carefully enough, particularly the # best option if using pvlib.forecast module
line added in #533. This is my fault, but it would be nice to have a big orange box rather than an (obvious) line buried in a code comment.
Would you accept a change to
By default, pvlib will not install some infrequently used dependencies.
If you run into an error such as
`ModuleNotFoundError: No module named 'netCDF4'`
you can either install pvlib with all optional dependencies using
`pip install pvlib[optional]`, or you can install pvlib from conda-forge
`conda create -n pvlib -c conda-forge pvlib-python; conda activate pvlib`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a big orange box is appropriate for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the wording. Let me know if you want any changes.
Sure, lgtm |
pvlib python pull request guidelines
Closes issue #xxxxdocs/sphinx/source/api.rst
for API changes.Adds description and name entries in the appropriatedocs/sphinx/source/whatsnew
file for all changes.Brief description of the problem and proposed solution (if not already fully described in the issue linked to above):
Add extra documentation to installation as discussed in this Google group post: https://groups.google.com/forum/#!topic/pvlib-python/QtvHELYmrww
Here is a screenshot of the docs as compiled locally: