When there are issues using Slicer application as the python interpreter, I suggest to fallback to using a the plain python interpreter also bundled in the Slicer package.
The following could be done:
Step 1
Open a terminal
Step 2
Source the Slicer environment
$ eval $(./Slicer --launcher-show-set-environment-commands)
Step 3
Install the package
Note that the name of the interpreter bundled with Slicer is python-real
and not python
$ python-real -m "pip" install scikit-image
Collecting scikit-image
Downloading scikit_image-0.13.1-cp27-cp27m-manylinux1_x86_64.whl (35.2MB)
...
Collecting matplotlib>=1.3.1 (from scikit-image)
Downloading matplotlib-2.2.0-cp27-cp27m-manylinux1_x86_64.whl (12.5MB)
....
Collecting networkx>=1.8 (from scikit-image)
Downloading networkx-2.1.zip (1.6MB)
[...]
Building wheels for collected packages: networkx, subprocess32
[...]
Running setup.py bdist_wheel for subprocess32 ... error
Complete output from command /home/jcfr/Downloads/Slicer-4.8.1-linux-amd64/bin/python-real -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vTIc2o/subprocess32/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpKY4kdZpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying subprocess32.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_posixsubprocess' extension
creating build/temp.linux-x86_64-2.7
/usr/bin/gcc-4.6 -pthread -Wall -Wstrict-prototypes -fno-strict-aliasing -fwrapv -g -fPIC -I/home/jcfr/Downloads/Slicer-4.8.1-linux-amd64/lib/Python/include/python2.7 -c _posixsubprocess.c -o build/temp.linux-x86_64-2.7/_posixsubprocess.o
unable to execute '/usr/bin/gcc-4.6': No such file or directory
error: command '/usr/bin/gcc-4.6' failed with exit status 1
----------------------------------------
Failed building wheel for subprocess32
Running setup.py clean for subprocess32
[...]
issue
While there are python 2.7 wheels for most of the dependencies (scikit_image itself, matplotlib, etc …), there are no per-built binaries for subprocess32
for linux for python 2.7. See https://pypi.python.org/pypi/subprocess32/3.5.0rc1 and https://pypi.python.org/pypi/subprocess32/3.2.7
On linux, the expectation is that user of the package is expected to build from source.
Few approaches:
-
Fix the build system of https://github.com/google/python-subprocess32 so that they use scikit-build to compile their code and generate while for python 2.7.
- I can provide guidance, this should be only few lines and the use of the dockcross/manylinux-x64 docker image to have package working on a broad set of linux distribution.
- Once a wheel is generated locally, you could install it first and then install scikit-image.
-
Use ITK python. Running
pip install itk
is expected to work. See http://itkpythonpackage.readthedocs.io/en/latest/