在安装mahotas软件包时使用命令:
pip3 install mahotas
但是终端中报了一大段错,看的我头皮发麻:
Building wheel for mahotas (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/yuzhe/.virtualenvs/py36env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-p7s5sv8d/mahotas/setup.py'"'"'; __file__='"'"'/tmp/pip-install-p7s5sv8d/mahotas/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/pip-wheel-becse5_h
cwd: /tmp/pip-install-p7s5sv8d/mahotas/
Complete output (130 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/mahotas
copying mahotas/freeimage.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/thresholding.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/edge.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/mahotas_version.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/zernike.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/features_cli.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/texture.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/distance.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/morph.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/bwperim.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/euler.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/surf.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/__init__.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/bbox.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/stretch.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/polygon.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/internal.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/moments.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/colors.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/segmentation.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/thin.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/lbp.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/center_of_mass.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/labeled.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/tas.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/_filters.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/resize.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/convolve.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/interpolate.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/histogram.py -> build/lib.linux-x86_64-3.6/mahotas
creating build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_histogram.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_internal.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_find.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_freeimage.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_dilate_erode.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_moments.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_watershed.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_template_match.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_thin.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_citation.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_gvoronoi.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_euler.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/utils.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_label.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_convolve.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_colors.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_edge.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_io.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_morph.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_features_shape.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_bwperim.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_median_filter.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/__init__.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_interpolate.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_center_of_mass.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_tas.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_thresholding.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_labeled.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_imresize.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_polygon.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_majority.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_texture.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_mean_filter.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_filters.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_close_holes.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_bbox.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_lbp.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_surf.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_zernike.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_mahotas.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_segmentation.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_surf_regression.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_demos.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/pymorph_copy.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_distance.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_hitmiss.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_stretch.py -> build/lib.linux-x86_64-3.6/mahotas/tests
creating build/lib.linux-x86_64-3.6/mahotas/io
copying mahotas/io/freeimage.py -> build/lib.linux-x86_64-3.6/mahotas/io
copying mahotas/io/__init__.py -> build/lib.linux-x86_64-3.6/mahotas/io
copying mahotas/io/pil.py -> build/lib.linux-x86_64-3.6/mahotas/io
creating build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/zernike.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/texture.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/surf.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/__init__.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/moments.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/lbp.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/tas.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/shape.py -> build/lib.linux-x86_64-3.6/mahotas/features
creating build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/thresholding.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/distance.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/superpixels.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/surf_luispedro.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/__init__.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/morphology.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/surf_gaussians.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/wally.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/nuclear_distance_watershed.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/nuclear.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/wavelet_compress.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/edge_demo.py -> build/lib.linux-x86_64-3.6/mahotas/demos
creating build/lib.linux-x86_64-3.6/mahotas/tests/data
copying mahotas/tests/data/1bpp.bmp -> build/lib.linux-x86_64-3.6/mahotas/tests/data
copying mahotas/tests/data/determinant_zero.png -> build/lib.linux-x86_64-3.6/mahotas/tests/data
copying mahotas/tests/data/luispedro.npy -> build/lib.linux-x86_64-3.6/mahotas/tests/data
copying mahotas/tests/data/rgba.png -> build/lib.linux-x86_64-3.6/mahotas/tests/data
creating build/lib.linux-x86_64-3.6/mahotas/demos/data
copying mahotas/demos/data/DepartmentStore.jpg -> build/lib.linux-x86_64-3.6/mahotas/demos/data
copying mahotas/demos/data/luispedro.jpg -> build/lib.linux-x86_64-3.6/mahotas/demos/data
copying mahotas/demos/data/lena.jpg -> build/lib.linux-x86_64-3.6/mahotas/demos/data
copying mahotas/demos/data/nuclear.png -> build/lib.linux-x86_64-3.6/mahotas/demos/data
running build_ext
building 'mahotas._bbox' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/mahotas
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=Mahotas_PyArray_API_Symbol -I/home/yuzhe/.virtualenvs/py36env/lib/python3.6/site-packages/numpy/core/include -I/home/yuzhe/.virtualenvs/py36env/include -I/usr/include/python3.6m -c mahotas/_bbox.cpp -o build/temp.linux-x86_64-3.6/mahotas/_bbox.o
In file included from mahotas/numpypp/array.hpp:17:0,
from mahotas/_bbox.cpp:11:
mahotas/numpypp/numpy.hpp:10:20: fatal error: Python.h: 没有那个文件或目录
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for mahotas
Running setup.py clean for mahotas
Failed to build mahotas
Installing collected packages: mahotas
Running setup.py install for mahotas ... error
ERROR: Command errored out with exit status 1:
command: /home/yuzhe/.virtualenvs/py36env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-p7s5sv8d/mahotas/setup.py'"'"'; __file__='"'"'/tmp/pip-install-p7s5sv8d/mahotas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-sq56bkd4/install-record.txt --single-version-externally-managed --compile --install-headers /home/yuzhe/.virtualenvs/py36env/include/site/python3.6/mahotas
cwd: /tmp/pip-install-p7s5sv8d/mahotas/
Complete output (130 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/mahotas
copying mahotas/freeimage.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/thresholding.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/edge.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/mahotas_version.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/zernike.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/features_cli.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/texture.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/distance.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/morph.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/bwperim.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/euler.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/surf.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/__init__.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/bbox.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/stretch.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/polygon.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/internal.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/moments.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/colors.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/segmentation.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/thin.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/lbp.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/center_of_mass.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/labeled.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/tas.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/_filters.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/resize.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/convolve.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/interpolate.py -> build/lib.linux-x86_64-3.6/mahotas
copying mahotas/histogram.py -> build/lib.linux-x86_64-3.6/mahotas
creating build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_histogram.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_internal.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_find.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_freeimage.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_dilate_erode.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_moments.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_watershed.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_template_match.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_thin.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_citation.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_gvoronoi.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_euler.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/utils.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_label.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_convolve.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_colors.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_edge.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_io.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_morph.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_features_shape.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_bwperim.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_median_filter.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/__init__.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_interpolate.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_center_of_mass.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_tas.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_thresholding.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_labeled.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_imresize.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_polygon.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_majority.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_texture.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_mean_filter.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_filters.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_close_holes.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_bbox.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_lbp.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_surf.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_zernike.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_mahotas.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_segmentation.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_surf_regression.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_demos.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/pymorph_copy.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_distance.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_hitmiss.py -> build/lib.linux-x86_64-3.6/mahotas/tests
copying mahotas/tests/test_stretch.py -> build/lib.linux-x86_64-3.6/mahotas/tests
creating build/lib.linux-x86_64-3.6/mahotas/io
copying mahotas/io/freeimage.py -> build/lib.linux-x86_64-3.6/mahotas/io
copying mahotas/io/__init__.py -> build/lib.linux-x86_64-3.6/mahotas/io
copying mahotas/io/pil.py -> build/lib.linux-x86_64-3.6/mahotas/io
creating build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/zernike.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/texture.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/surf.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/__init__.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/moments.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/lbp.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/tas.py -> build/lib.linux-x86_64-3.6/mahotas/features
copying mahotas/features/shape.py -> build/lib.linux-x86_64-3.6/mahotas/features
creating build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/thresholding.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/distance.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/superpixels.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/surf_luispedro.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/__init__.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/morphology.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/surf_gaussians.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/wally.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/nuclear_distance_watershed.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/nuclear.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/wavelet_compress.py -> build/lib.linux-x86_64-3.6/mahotas/demos
copying mahotas/demos/edge_demo.py -> build/lib.linux-x86_64-3.6/mahotas/demos
creating build/lib.linux-x86_64-3.6/mahotas/tests/data
copying mahotas/tests/data/1bpp.bmp -> build/lib.linux-x86_64-3.6/mahotas/tests/data
copying mahotas/tests/data/determinant_zero.png -> build/lib.linux-x86_64-3.6/mahotas/tests/data
copying mahotas/tests/data/luispedro.npy -> build/lib.linux-x86_64-3.6/mahotas/tests/data
copying mahotas/tests/data/rgba.png -> build/lib.linux-x86_64-3.6/mahotas/tests/data
creating build/lib.linux-x86_64-3.6/mahotas/demos/data
copying mahotas/demos/data/DepartmentStore.jpg -> build/lib.linux-x86_64-3.6/mahotas/demos/data
copying mahotas/demos/data/luispedro.jpg -> build/lib.linux-x86_64-3.6/mahotas/demos/data
copying mahotas/demos/data/lena.jpg -> build/lib.linux-x86_64-3.6/mahotas/demos/data
copying mahotas/demos/data/nuclear.png -> build/lib.linux-x86_64-3.6/mahotas/demos/data
running build_ext
building 'mahotas._bbox' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/mahotas
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=Mahotas_PyArray_API_Symbol -I/home/yuzhe/.virtualenvs/py36env/lib/python3.6/site-packages/numpy/core/include -I/home/yuzhe/.virtualenvs/py36env/include -I/usr/include/python3.6m -c mahotas/_bbox.cpp -o build/temp.linux-x86_64-3.6/mahotas/_bbox.o
In file included from mahotas/numpypp/array.hpp:17:0,
from mahotas/_bbox.cpp:11:
mahotas/numpypp/numpy.hpp:10:20: fatal error: Python.h: 没有那个文件或目录
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/yuzhe/.virtualenvs/py36env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-p7s5sv8d/mahotas/setup.py'"'"'; __file__='"'"'/tmp/pip-install-p7s5sv8d/mahotas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-sq56bkd4/install-record.txt --single-version-externally-managed --compile --install-headers /home/yuzhe/.virtualenvs/py36env/include/site/python3.6/mahotas Check the logs for full command output.
挖掘上边报错的关键词、关键句 有以下几个:
ERROR: Command errored out with exit status 1:
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
mahotas/numpypp/numpy.hpp:10:20: fatal error: Python.h: 没有那个文件或目录
ERROR: Failed building wheel for mahotas
我上网把上边的错误搜了一遍,主要有以下可能:
(1)如果是在windows下的python环境安装mahotas,可能是要下载whl文件:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
ctrl+f找到mahotas,下载对应版本,比如cp36是python3.6,win32是32位系统,amd64是64位系统
(2)可是我的是Ubuntu系统耶,尝试:
sudo apt-get install python3-dev
sudo apt-get install libevent-dev
但是再次尝试安装还是不行。。。。
突然我想起了之前自己python3.5升级到python3.6时,仍然保持默认python3版本为python3.5.。。。。
应该是sudo apt-get install python3-dev安装了python3.5的头文件和静态库???于是执行:
sudo apt-get install python3.6-dev
再次执行安装命令后安装成功!!!!