jakevdp / PythonDataScienceHandbook

Python Data Science Handbook: full text in Jupyter Notebooks
http://jakevdp.github.io/PythonDataScienceHandbook
MIT License
42.69k stars 17.81k forks source link

Python 3.6, old scikit-image and numpy. Install from requirements.txt fails. #108

Open GrahamDumpleton opened 6 years ago

GrahamDumpleton commented 6 years ago

FYI.

The current requirements.txt file will fail for Python 3.6 and pip when used on fresh Python environment.


+ pip install -r requirements.txt
--
  | Collecting numpy==1.11.1 (from -r requirements.txt (line 1))
  | Downloading numpy-1.11.1.zip (4.7MB)
  | Collecting pandas==0.18.1 (from -r requirements.txt (line 2))
  | Downloading pandas-0.18.1.tar.gz (7.3MB)
  | Collecting scipy==0.17.1 (from -r requirements.txt (line 3))
  | Downloading scipy-0.17.1.tar.gz (12.4MB)
  | Collecting scikit-learn==0.17.1 (from -r requirements.txt (line 4))
  | Downloading scikit-learn-0.17.1.tar.gz (7.9MB)
  | Collecting scikit-image==0.12.3 (from -r requirements.txt (line 5))
  | Downloading scikit-image-0.12.3.tar.gz (20.7MB)
  | Complete output from command python setup.py egg_info:
  | To install scikit-image from source, you will need numpy.
  | Install numpy with pip:
  | pip install numpy
  | Or use your operating system package manager. For more
  | details, see http://scikit-image.org/docs/stable/install.html

This is because the older version of scikit-image has a check to see if numpy is already installed, but it doesn't avoid the check when running setup.py with egg_info command.

Under Python 3.6, pip is triggering egg_info where as under Python 3.5 it appears it wasn't.

Newer scikit-image checks for egg_info and skips the check and so likely doesn't have the problem.

In summary, while continue to use older scikit-image package, there is a risk the requirements.txt file will not work with Python 3.6 and pip.

You might want to consider seeing whether code samples work with newer scikit-image package and update to newer version of that package to avoid issue. Obviously everything else also needs to be check for Python 3.6 in general as well.

GrahamDumpleton commented 6 years ago

It may be worthwhile adding a runtime.txt file to the repo which includes python-3.5 in it. That way tools (such as BinderHub) which automatically build the repo into a container image and which already use that file will keep using Python 3.5 if they decide to start supporting both Python 3.5 and 3.6.

cc @yuvipanda

yuvipanda commented 6 years ago

I think appropriate long term answer here is to wait for fix in scikit-image rather than pin to python 3.5 :) We won't bump default to python 3.6 until we know a lot of packages have things fixed and what not (this repo is actually in our CI systems so we don't break it!). Thank you for letting us know about this however!

GrahamDumpleton commented 6 years ago

The problem in scikit-image relates to the older 0.12.X branch only. It should not affect the newer 0.13.X branch. So this is only an issue if people using older scikit. They are unlikely to bring out a fix for older branch unless they have a history of back porting fixes.

yuvipanda commented 6 years ago

We're going to bump default version of Python on Binder soon to 3.6, and that is causing this repo to break. A bump on the scikit-image dependency maybe?