mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-27 17:17:07 +08:00
Revert "Update install instructions, simplify requirements"
This commit is contained in:
+21
-17
@@ -1,28 +1,32 @@
|
||||
Build Requirements
|
||||
------------------
|
||||
* `Python >= 2.6 <http://python.org>`__
|
||||
* `Numpy >= 1.6.1 <http://numpy.scipy.org/>`__
|
||||
* `Numpy >= 1.6 <http://numpy.scipy.org/>`__
|
||||
* `Cython >= 0.21 <http://www.cython.org/>`__
|
||||
* `Six >=1.4 <https://pypi.python.org/pypi/six>`__
|
||||
* `SciPy >=0.9 <http://scipy.org>`__
|
||||
* `Six >=1.3 <https://pypi.python.org/pypi/six>`__
|
||||
|
||||
Runtime requirements
|
||||
--------------------
|
||||
* `Python >= 2.6 <http://python.org>`__
|
||||
* `Numpy >= 1.6.1 <http://numpy.scipy.org/>`__
|
||||
* `SciPy >= 0.9 <http://scipy.org>`__
|
||||
* `Matplotlib >= 1.1.0 <http://matplotlib.sf.net>`__
|
||||
* `NetworkX >= 1.8 <https://networkx.github.io>`__
|
||||
* `Six >=1.4 <https://pypi.python.org/pypi/six>`__
|
||||
* `Pillow >= 1.7.8 <https://pypi.python.org/pypi/Pillow>`__
|
||||
(or `PIL <http://www.pythonware.com/products/pil/>`__)
|
||||
* `dask[array] >= 0.5.0 <http://dask.pydata.org/en/latest/>`__
|
||||
|
||||
|
||||
You can use pip to automatically install the runtime dependencies as follows::
|
||||
You can use pip to automatically install the base dependencies as follows::
|
||||
|
||||
$ pip install -r requirements.txt
|
||||
|
||||
Runtime requirements
|
||||
--------------------
|
||||
* `SciPy <http://scipy.org>`__
|
||||
* `Matplotlib <http://matplotlib.sf.net>`__
|
||||
* `NetworkX <https://networkx.github.io>`__
|
||||
* `Pillow <https://pypi.python.org/pypi/Pillow>`__
|
||||
(or `PIL <http://www.pythonware.com/products/pil/>`__)
|
||||
* `dask array <http://dask.pydata.org/en/latest/>`__
|
||||
|
||||
Known build errors
|
||||
------------------
|
||||
On Windows, the error ``Error:unable to find vcvarsall.bat`` means that
|
||||
distutils is not correctly configured to use the C compiler. Modify (or create,
|
||||
if not existing) the configuration file ``distutils.cfg`` (located for
|
||||
example at ``C:\Python26\Lib\distutils\distutils.cfg``) to contain::
|
||||
|
||||
[build]
|
||||
compiler=mingw32
|
||||
|
||||
Optional Requirements
|
||||
---------------------
|
||||
|
||||
+34
-156
@@ -1,153 +1,53 @@
|
||||
Installing scikit-image
|
||||
-----------------------
|
||||
If you are on Mac OS X you're lucky, open the terminal and install
|
||||
scikit-image with pip::
|
||||
|
||||
pip install scikit-image
|
||||
|
||||
|
||||
For Python 3 use pip3 instead::
|
||||
|
||||
pip3 install scikit-image
|
||||
|
||||
|
||||
For other systems, please read on.
|
||||
|
||||
|
||||
Linux, Mac and Windows
|
||||
Pre-built installation
|
||||
----------------------
|
||||
An easy light weight method to get scikit-image installed on all of the most
|
||||
popular operating systems is by using miniconda_. Go over and grab the
|
||||
appropriate miniconda_ version for your operating system and install it. When
|
||||
you have miniconda_ installed, open a terminal and install scikit-image
|
||||
with conda::
|
||||
|
||||
conda install scikit-image
|
||||
`Windows binaries
|
||||
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-image>`__
|
||||
are kindly provided by Christoph Gohlke (note that, when upgrading,
|
||||
you should first uninstall any older versions).
|
||||
|
||||
The latest stable release is also included as part of
|
||||
`Enthought Canopy <https://www.enthought.com/products/canopy/>`__,
|
||||
`Python(x,y) <http://code.google.com/p/pythonxy/wiki/Welcome>`__ and
|
||||
`Anaconda <https://store.continuum.io/cshop/anaconda/>`__.
|
||||
|
||||
If you prefer *not* using miniconda, find instructions for your operating
|
||||
system below.
|
||||
On Debian and Ubuntu, a Debian package ``python-skimage`` can be found in
|
||||
`the Neurodebian repository <http://neuro.debian.net>`__. Follow `the
|
||||
instructions <http://neuro.debian.net/#how-to-use-this-repository>`__ to
|
||||
add Neurodebian to your system package manager, then look for
|
||||
``python-skimage`` in the package manager.
|
||||
|
||||
On systems that support setuptools, the package can be installed from the
|
||||
`Python packaging index <http://pypi.python.org/pypi/scikit-image>`__ using
|
||||
|
||||
Windows
|
||||
-------
|
||||
Scikit-image comes with the Python distributions Anaconda_,
|
||||
`Enthought Canopy`_ and `Python(x,y)`_. If you install any of
|
||||
them, scikit-image should already be installed.
|
||||
::
|
||||
|
||||
.. _Anaconda: https://store.continuum.io/cshop/anaconda/
|
||||
.. _Enthought Canopy: https://www.enthought.com/products/canopy/
|
||||
.. _Python(x,y): http://code.google.com/p/pythonxy/wiki/Welcome
|
||||
pip install -U scikit-image
|
||||
|
||||
Installation from source
|
||||
------------------------
|
||||
|
||||
If you prefer the regular Python distribution from python.org_, you can
|
||||
install scikit-image manually by downloading packages. You will need numpy_,
|
||||
scipy_ and the scikit-image package. You can find the packages in `Cristoph
|
||||
Gohlke's`_ web page with compiled Python packages. Here is the direct link to
|
||||
the `scipy section`_, `numpy section`_ and `scikit-image section`_. Make sure
|
||||
you download the right version for your system. E.g. numpy for Python 3.4 64
|
||||
bit would be ``numpy‑1.9.2+mkl‑cp34‑none‑win_amd64.whl``.
|
||||
Obtain the source from the git-repository at
|
||||
`http://github.com/scikit-image/scikit-image
|
||||
<http://github.com/scikit-image/scikit-image>`_ by running::
|
||||
|
||||
To install Goehlke's packages, use pip::
|
||||
git clone http://github.com/scikit-image/scikit-image.git
|
||||
|
||||
pip install wheel
|
||||
pip install --find-links Downloads scikit-image
|
||||
in a terminal (you will need to have git installed on your machine).
|
||||
|
||||
Here ``--find-links Downloads`` means that pip will look for packages in the
|
||||
folder named `Downloads`. Make sure that is where you saved the packages from
|
||||
Goehlke.
|
||||
If you do not have git installed, you can also download a zipball from
|
||||
`https://github.com/scikit-image/scikit-image/zipball/master
|
||||
<https://github.com/scikit-image/scikit-image/zipball/master>`_.
|
||||
|
||||
As you see, installing scikit-image with pip requires some extra manual labor,
|
||||
so using a Python distribution is recommended on Windows.
|
||||
The scikit can be installed using::
|
||||
|
||||
If you have a brave soul, you can also install scikit-image on Windows by
|
||||
compiling it from source::
|
||||
pip install .
|
||||
|
||||
pip install scikit-image
|
||||
|
||||
|
||||
If you experience the error ``Error:unable to find vcvarsall.bat`` it means that
|
||||
distutils is not correctly configured to use the C compiler. Modify (or create,
|
||||
if not existing) the configuration file ``distutils.cfg`` (located for
|
||||
example at ``C:\Python26\Lib\distutils\distutils.cfg``) to contain::
|
||||
|
||||
[build]
|
||||
compiler=mingw32
|
||||
|
||||
For more details on compiling in Windows, there is a lot of knowledge iterated
|
||||
into the `setup of appveyor`_ (a continious integration service).
|
||||
|
||||
.. _miniconda: http://conda.pydata.org/miniconda.html
|
||||
.. _python.org: http://python.org/
|
||||
.. _numpy: http://www.numpy.org/
|
||||
.. _scipy: http://www.scipy.org/
|
||||
.. _Cristoph Gohlke's: http://www.lfd.uci.edu/~gohlke/pythonlibs/
|
||||
.. _numpy section: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
|
||||
.. _scipy section: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
|
||||
.. _scikit-image section: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-image
|
||||
.. _setup of appveyor: https://github.com/scikit-image/scikit-image/blob/master/appveyor.yml
|
||||
|
||||
|
||||
Debian and Ubuntu
|
||||
-----------------
|
||||
On Debian and Ubuntu install scikit-image with::
|
||||
|
||||
sudo apt-get install python-skimage
|
||||
|
||||
|
||||
Or if you use Python 3::
|
||||
|
||||
sudo apt-get install python3-skimage
|
||||
|
||||
|
||||
On Ubuntu scikit-image is found in the `universe repo`_, and python-skimage can
|
||||
also be found in the `Neurodebian repository`_. For using the repository
|
||||
follow the `Neurodebian instructions`_ to add Neurodebian to your system
|
||||
package manager.
|
||||
|
||||
Ubuntu 14.04 LTS ships with version 0.9.3 of scikit-image, so if you need an
|
||||
up-to-date version you must compile scikit-image yourself. First install the
|
||||
dependencies::
|
||||
|
||||
sudo apt-get install python-matplotlib python-numpy python-pil python-scipy
|
||||
|
||||
|
||||
or for Python 3::
|
||||
|
||||
sudo apt-get install python3-matplotlib python3-numpy python3-pil python3-scipy
|
||||
|
||||
|
||||
Get compilers::
|
||||
|
||||
sudo apt-get install build-essential cython
|
||||
|
||||
|
||||
Compile and install the latest stable version of scikit-image::
|
||||
|
||||
pip install scikit-image
|
||||
|
||||
|
||||
.. _universe repo: https://help.ubuntu.com/community/Repositories/Ubuntu
|
||||
.. _Neurodebian repository: http://neuro.debian.net/
|
||||
.. _Neurodebian instructions: http://neuro.debian.net/#how-to-use-this-repository
|
||||
|
||||
|
||||
Other Unixes
|
||||
------------
|
||||
Install binary packages of cython, matplotlib, numpy, pillow and scipy if they
|
||||
are available in your operating system's package manager. Make sure you have
|
||||
a C and C++ compilers. Then install scikit-image with pip::
|
||||
|
||||
pip install scikit-image
|
||||
|
||||
|
||||
Upgrading
|
||||
---------
|
||||
You can upgrade scikit-image by::
|
||||
|
||||
pip install --upgrade --no-deps scikit-image
|
||||
pip install scikit-image # installs new dependencies, if changed
|
||||
If you prefer, you can use it without installing, by simply adding
|
||||
this path to your ``PYTHONPATH`` variable and compiling extensions
|
||||
in-place::
|
||||
|
||||
python setup.py build_ext -i
|
||||
|
||||
Building with bento
|
||||
-------------------
|
||||
@@ -173,26 +73,4 @@ From the ``scikit-image`` source directory::
|
||||
Depending on file permissions, the install commands may need to be run as
|
||||
sudo.
|
||||
|
||||
|
||||
Install bleeding edge development version
|
||||
-----------------------------------------
|
||||
|
||||
Obtain the source from the git-repository at
|
||||
http://github.com/scikit-image/scikit-image by running::
|
||||
|
||||
git clone http://github.com/scikit-image/scikit-image
|
||||
|
||||
If you do not have git installed on your machine, you can also download a
|
||||
zipball from https://github.com/scikit-image/scikit-image/zipball/master.
|
||||
|
||||
The scikit can be installed using::
|
||||
|
||||
pip install .
|
||||
|
||||
If you prefer, you can use a link instead by compiling extensions in-place::
|
||||
|
||||
python setup.py build_ext -i
|
||||
pip install -e .
|
||||
|
||||
|
||||
.. include:: ../../DEPENDS.txt
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
cython>=0.21
|
||||
matplotlib>=1.1.0
|
||||
numpy>=1.6.1
|
||||
scipy>=0.9.0
|
||||
six>=1.4
|
||||
scipy>=0.9
|
||||
six>=1.3
|
||||
networkx>=1.8
|
||||
pillow>=1.7.8
|
||||
dask[array]>=0.5.0
|
||||
|
||||
@@ -34,10 +34,24 @@ with open('skimage/__init__.py') as fid:
|
||||
with open('requirements.txt') as fid:
|
||||
INSTALL_REQUIRES = [l.strip() for l in fid.readlines() if l]
|
||||
|
||||
# requirements for those browsing PyPI
|
||||
REQUIRES = [r.replace('>=', ' (>= ') + ')' for r in INSTALL_REQUIRES]
|
||||
# development versions do not have the cythonized files
|
||||
if VERSION.endswith('dev'):
|
||||
SETUP_REQUIRES = [r for r in INSTALL_REQUIRES if r.startswith('cython')]
|
||||
else:
|
||||
INSTALL_REQUIRES = [r for r in INSTALL_REQUIRES
|
||||
if not r.startswith('cython')]
|
||||
SETUP_REQUIRES = []
|
||||
|
||||
|
||||
# list requirements for PyPI
|
||||
REQUIRES = [r.replace('>=', ' (>= ') + ')'
|
||||
for r in INSTALL_REQUIRES + SETUP_REQUIRES]
|
||||
REQUIRES = [r.replace('==', ' (== ') for r in REQUIRES]
|
||||
REQUIRES = [r.replace('[array]', '') for r in REQUIRES]
|
||||
|
||||
|
||||
# do not attempt to install numpy and scipy until they have eggs available
|
||||
INSTALL_REQUIRES = [r for r in INSTALL_REQUIRES
|
||||
if not r.startswith(('scipy', 'numpy'))]
|
||||
|
||||
|
||||
def configuration(parent_package='', top_path=None):
|
||||
@@ -59,17 +73,9 @@ def configuration(parent_package='', top_path=None):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# purposely fail if numpy is not available
|
||||
# other dependecies will be resolved by pip (install_requires)
|
||||
try:
|
||||
from numpy.distutils.core import setup
|
||||
except ImportError:
|
||||
print('To install scikit-image from source, you will need numpy.\n' +
|
||||
'Install numpy with pip:\n' +
|
||||
'pip install numpy\n'
|
||||
'Or use your operating system package manager. For more\n' +
|
||||
'details, see http://scikit-image.org/docs/stable/install.html')
|
||||
sys.exit(1)
|
||||
# purposely fail loudly if numpy or scipy are not available
|
||||
from numpy.distutils.core import setup
|
||||
import scipy
|
||||
|
||||
setup(
|
||||
name=DISTNAME,
|
||||
@@ -99,9 +105,8 @@ if __name__ == "__main__":
|
||||
],
|
||||
|
||||
configuration=configuration,
|
||||
setup_requires=SETUP_REQUIRES,
|
||||
install_requires=INSTALL_REQUIRES,
|
||||
# install cython when running setup.py (source install)
|
||||
setup_requires=['cython>=0.21'],
|
||||
requires=REQUIRES,
|
||||
packages=setuptools.find_packages(exclude=['doc']),
|
||||
include_package_data=True,
|
||||
|
||||
@@ -230,9 +230,9 @@ class TestSaveTIF:
|
||||
def roundtrip(self, dtype, x, compress):
|
||||
with temporary_file(suffix='.tif') as fname:
|
||||
if dtype == np.bool:
|
||||
expected = ['low contrast|unclosed file']
|
||||
expected = ['low contrast']
|
||||
else:
|
||||
expected = ['unclosed file|\A\Z']
|
||||
expected = []
|
||||
with expected_warnings(expected):
|
||||
if compress > 0:
|
||||
imsave(fname, x, compress=compress)
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
# wheels are preferred for a given version
|
||||
numpy==1.8.1
|
||||
scipy==0.14.0
|
||||
cython>=0.21
|
||||
cython==0.20.2
|
||||
matplotlib==1.4.2
|
||||
pillow==2.6.1
|
||||
dask[array]>=0.5.0
|
||||
wheel
|
||||
nose
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
export WHEELHOUSE="--no-index --trusted-host travis-wheels.scikit-image.org \
|
||||
--find-links=http://travis-wheels.scikit-image.org/"
|
||||
export WHEELHOUSE="--no-index --find-links=http://travis-wheels.scikit-image.org/"
|
||||
export COVERALLS_REPO_TOKEN=7LdFN9232ZbSY3oaXHbQIzLazrSf6w2pQ
|
||||
export PIP_DEFAULT_TIMEOUT=60
|
||||
sh -e /etc/init.d/xvfb start
|
||||
export DISPLAY=:99.0
|
||||
export PYTHONWARNINGS="all"
|
||||
export TEST_ARGS="--exe --ignore-files=^_test -v --with-doctest \
|
||||
--ignore-files=^setup.py$"
|
||||
WHEELBINARIES="matplotlib numpy scipy pillow cython"
|
||||
export TEST_ARGS="--exe --ignore-files=^_test -v --with-doctest --ignore-files=^setup.py$"
|
||||
|
||||
|
||||
retry () {
|
||||
# https://gist.github.com/fungusakafungus/1026804
|
||||
@@ -29,21 +27,20 @@ retry () {
|
||||
return 0
|
||||
}
|
||||
|
||||
# add build dependencies
|
||||
echo "cython>=0.21" >> requirements.txt
|
||||
|
||||
# test minimum requirements on 2.7
|
||||
# on Python 2.7, use the system versions of numpy, scipy, and matplotlib
|
||||
# and the minimum version of cython and networkx
|
||||
if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then
|
||||
sed -i 's/>=/==/g' requirements.txt
|
||||
# PIL instead of Pillow
|
||||
sed -i 's/pillow.*/pil==1.1.7/g' requirements.txt
|
||||
WHEELBINARIES=${WHEELBINARIES/pillow/pil}
|
||||
virtualenv --system-site-packages ~/venv
|
||||
sudo apt-get install python-scipy python-matplotlib python-imaging
|
||||
sed -i 's/cython>=/cython==/g' requirements.txt
|
||||
sed -i 's/networkx>=/networkx==/g' requirements.txt
|
||||
sed -i '/pillow/d' requirements.txt
|
||||
else
|
||||
virtualenv -p python --system-site-packages ~/venv
|
||||
fi
|
||||
|
||||
# create new empty venv
|
||||
virtualenv -p python ~/venv
|
||||
source ~/venv/bin/activate
|
||||
|
||||
retry pip install wheel flake8 coveralls nose
|
||||
|
||||
# install system tk for matplotlib
|
||||
@@ -52,16 +49,12 @@ sudo apt-get install python-tk
|
||||
|
||||
# on Python 3.2, use matplotlib 1.3.1
|
||||
if [[ $TRAVIS_PYTHON_VERSION == 3.2 ]]; then
|
||||
sed -i 's/matplotlib>=.*/matplotlib==1.3.1/g' requirements.txt
|
||||
sed -i 's/matplotlib>=*.*.*/matplotlib==1.3.1/g' requirements.txt
|
||||
fi
|
||||
|
||||
# install wheels
|
||||
for requirement in $WHEELBINARIES; do
|
||||
WHEELS="$WHEELS $(grep $requirement requirements.txt)"
|
||||
done
|
||||
retry pip install $WHEELHOUSE $WHEELS
|
||||
retry pip install $WHEELHOUSE -r requirements.txt
|
||||
|
||||
retry pip install -r requirements.txt
|
||||
pip install 'dask[array]>=0.5.0'
|
||||
|
||||
# clean up disk space
|
||||
sudo apt-get clean
|
||||
|
||||
Reference in New Issue
Block a user