AlpacaKing
AlpacaKing

Reputation: 381

Installation error of scikit-image in python-3.11.0

Getting errors when installing scikit-image with python-3.11.0.

The package is simply installed via pip install scikit-image or python -m pip install -U scikit-image.

The error messages showed that the problem occur on the wheel building process, and therefore hinder the scikit-image installation. How could I fix this problem?

Error messages:

 error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      INFO: CCompilerOpt.cache_flush[857] : write cache to path -> C:\Users\admin\AppData\Local\Temp\pip-install-z_bg8g6d\scikit-image_ae4333805d744761b97e8cd984f9e2c1\build\temp.win-amd64-3.11\Release\ccompiler_opt_cache_ext.py
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for scikit-image
Failed to build scikit-image
ERROR: Could not build wheels for scikit-image, which is required to install pyproject.toml-based projects

Environment:

affine==2.3.1
attrs==22.1.0
beautifulsoup4==4.11.1
certifi==2022.9.24
charset-normalizer==2.1.1
click==8.1.3
click-plugins==1.1.1
cligj==0.7.2
colorama==0.4.6
contourpy==1.0.6
cycler==0.11.0
docopt==0.6.2
Fiona @ file:///C:/Users/admin/pipwin/Fiona-1.8.21-cp311-cp311-win_amd64.whl
fonttools==4.38.0
GDAL @ file:///C:/Users/admin/pipwin/GDAL-3.4.3-cp311-cp311-win_amd64.whl
geopandas==0.12.1
idna==3.4
Js2Py==0.74
kiwisolver==1.4.4
matplotlib==3.6.2
munch==2.5.0
numpy==1.23.4
opencv-contrib-python==4.6.0.66
packaging==21.3
pandas==1.5.1
Pillow==9.3.0
pipwin==0.5.2
pyjsparser==2.7.1
pyparsing==3.0.9
PyPrind==2.11.3
pyproj==3.4.0
pySmartDL==1.3.4
python-dateutil==2.8.2
pytz==2022.6
pytz-deprecation-shim==0.1.0.post0
rasterio==1.3.3
requests==2.28.1
rioxarray==0.12.4
Shapely==1.8.5.post1
six==1.16.0
snuggs==1.4.7
soupsieve==2.3.2.post1
tzdata==2022.6
tzlocal==4.2
urllib3==1.26.12
xarray==2022.11.0

Two approaches were suggested:

  1. Downgrades to an older python version: Nathan answer
  2. Install Visual Studio C++ compiler, as mentioned in: https://wiki.python.org/moin/WindowsCompilers

However, I would like to stay on current python version, and I'm getting stuck in the second approach.

Upvotes: 3

Views: 6312

Answers (1)

AlpacaKing
AlpacaKing

Reputation: 381

In my case, this problem was solved via installing a wheel file from:

https://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-image

In my case, I download the cp311 windows amd64 version.

enter image description here

Then, install the .whl file to the virtual environment

(env) D:\env>python -m pip install D:\Download\scikit_image-0.19.3-cp311-cp311-win_amd64.whl

Finally, the scikit-image was successfully installed.

enter image description here

Upvotes: 6

Related Questions