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

Invalid requirements.txt file. #3

Closed
GrahamDumpleton opened this issue Nov 19, 2016 · 11 comments
Closed

Invalid requirements.txt file. #3

GrahamDumpleton opened this issue Nov 19, 2016 · 11 comments

Comments

@GrahamDumpleton
Copy link

GrahamDumpleton commented Nov 19, 2016

The requirements.txt file has:

numpy=1.11
pandas=0.18.1
scipy=0.17.1
sklearn=0.17.1
matplotlib=1.5.1
jupyter
notebook
line_profiler
memory_profiler

which will be rejected by pip.

Invalid requirement: 'numpy=1.11'
= is not a valid operator. Did you mean == ?

Need to change = to == in each instance where pinning the version.

@GrahamDumpleton
Copy link
Author

Even fixing those, you get the error:

Collecting sklearn==0.17.1 (from -r requirements.txt (line 4))
  Could not find a version that satisfies the requirement sklearn==0.17.1 (from -r requirements.txt (line 4)) (from versions: 0.0)
No matching distribution found for sklearn==0.17.1 (from -r requirements.txt (line 4))

So wrong package name or version.

@GrahamDumpleton
Copy link
Author

Assuming you probably meant:

scikit-learn==0.17.1

@GrahamDumpleton
Copy link
Author

Missing package:

seaborn

@GrahamDumpleton
Copy link
Author

The sklearn package is actually used, so maybe it was just that version was wrong. Unless scikit-learn also installs its own alias module called sklearn.

@GrahamDumpleton
Copy link
Author

A bit of background as to why pushing for requirements.txt to be accurate.

Systems exist whereby you can reference a Git repository such as this and it will automatically construct a Docker image for you that has all the packages listed in requirements.txt installed. The Docker image is also set up so it will automatically start up Jupyter notebook server with the contents of the repository copied into the image.

This represents an easy way for people to experiment with your notebooks as they can do this using a hosting service which supports such a build mechanism for repositories with notebooks and a requirements.txt file containing listing all the packages they need.

This is a bit different to something like tmpnb.org, which just uses a really fat Jupyter image, which may to may not have all the packages you need. The other systems will install exactly which packages you say you need and what version if pinned. They can also install Python packages which are a part of the repository as well so long as they are reference in the requirements.txt the location of the code in the repository using a relative file system path.

Am happy to demonstrate such a system to you in a hangout if interested.

@jakevdp
Copy link
Owner

jakevdp commented Nov 19, 2016

Thanks – this is all in-progress and I will update as I edit and add the notebooks.

@GrahamDumpleton
Copy link
Author

FWIW. I think this is what I ended up with in the end for requirements.txt:

numpy
pandas
scipy
scikit-learn
seaborn
matplotlib
jupyter
notebook
line_profiler
memory_profiler
https://github.com/matplotlib/basemap/archive/master.zip
netCDF4
numexpr
pandas_datareader
Pillow
scikit-image

Dropped pinned versions to try work out lang/locale encoding issue with matplolib.pyplot, but didn't help.

Full list of packages and versions installed was:

backports-abc==0.5                                                                                                                  
backports.shutil-get-terminal-size==1.0.0                                                                                           
basemap==1.0.8                                                                                                                      
certifi==2016.9.26                                                                                                                  
configparser==3.5.0                                                                                                                 
cycler==0.10.0                                                                                                                      
dask==0.12.0                                                                                                                        
decorator==4.0.10                                                                                                                   
entrypoints==0.2.2                                                                                                                  
enum34==1.1.6                                                                                                                       
functools32==3.2.3.post2                                                                                                            
futures==3.0.5                                                                                                                      
ipykernel==4.5.1                                                                                                                    
ipyparallel==5.2.0                                                                                                                  
ipython==5.1.0                                                                                                                      
ipython-genutils==0.1.0                                                                                                             
ipywidgets==5.2.2                                                                                                                   
Jinja2==2.8                                                                                                                         
jsonschema==2.5.1                                                                                                                   
jupyter==1.0.0                                                                                                                      
jupyter-client==4.4.0                                                                                                               
jupyter-console==5.0.0                                                                                                              
jupyter-core==4.2.0                                                                                                                 
line-profiler==2.0                                                                                                                  
MarkupSafe==0.23                                                                                                                    
matplotlib==1.5.3                                                                                                                   
memory-profiler==0.41                                                                                                               
mistune==0.7.3                                                                                                                      
mod-wsgi==4.5.7                                                                                                                     
nbconvert==4.2.0                                                                                                                    
nbformat==4.1.0                                                                                                                     
netCDF4==1.2.4                                                                                                                      
networkx==1.11                                                                                                                      
notebook==4.2.3                                                                                                                     
numexpr==2.6.1                                                                                                                      
numpy==1.11.2                                                                                                                       
pandas==0.19.1                                                                                                                      
pandas-datareader==0.2.1                                                                                                            
pathlib2==2.1.0                                                                                                                     
pexpect==4.2.1                                                                                                                      
pickleshare==0.7.4                                                                                                                  
Pillow==3.4.2                                                                                                                       
prompt-toolkit==1.0.9                                                                                                               
ptyprocess==0.5.1                                                                                                                   
Pygments==2.1.3                                                                                                                     
pyparsing==2.1.10                                                                                                                   
pyproj==1.9.5.1                                                                                                                     
pyshp==1.2.10                                                                                                                       
python-dateutil==2.6.0                                                                                                              
pytz==2016.7                                                                                                                        
pyzmq==16.0.1                                                                                                                       
qtconsole==4.2.1                                                                                                                    
requests==2.12.1                                                                                                                    
requests-file==1.4.1                                                                                                                
scikit-image==0.12.3                                                                                                                
scikit-learn==0.18.1                                                                                                                
scipy==0.18.1                                                                                                                       
seaborn==0.7.1                                                                                                                      
simplegeneric==0.8.1                                                                                                                
singledispatch==3.4.0.3                                                                                                             
six==1.10.0                                                                                                                         
terminado==0.6                                                                                                                      
toolz==0.8.0                                                                                                                        
tornado==4.4.2                                                                                                                      
traitlets==4.3.1                                                                                                                    
wcwidth==0.1.7                                                                                                                      
widgetsnbextension==1.2.6 

This may have a few extras over the minimum required as my base Docker image also installs ipyparallel by default as the image is partly targeted at parallel computing usage and so embedded functionality for creating a distributed cluster of compute engines.

This doesn't do anything about addressing missing helpers_05_08 module.

@jakevdp
Copy link
Owner

jakevdp commented Nov 21, 2016

Thanks. I am building the file as I go through the final edits. What's currently there is what's needed for chapters 1-2, and I'll add the rest as I go along.

@jakevdp
Copy link
Owner

jakevdp commented Nov 21, 2016

As for the rest - I haven't finished finalizing the repo yet. Please be patient.

@jakevdp
Copy link
Owner

jakevdp commented Nov 21, 2016

It would probably make things less confusing if I deleted all the code-only notebooks, but I decided not to do that until all the text is posted.

@jakevdp
Copy link
Owner

jakevdp commented Nov 23, 2016

requirements is fixed now.

@jakevdp jakevdp closed this as completed Nov 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants