Jeb50
Jeb50

Reputation: 7037

Unable to Install scipy.ndimage

Because VSC says unresolved import 'scipy.ndimage' for from scipy.ndimage import interpolation as inter So I found the binary package for Windows at the bottom of https://scipy.org/install.html. I was able to

  1. successfully install the required Windows VC++ buildtool, reboot
  2. download the ndimage-1.3.1.tar.gz from above
  3. python setup.py install gave me following error
building 'ndimage._lib._ccallback_c' extension
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Indimage/src -Indimage/_lib "-IC:\Program Files (x86)\Python37-32\include" "-IC:\Program Files (x86)\Python37-32\include" "-IC:\Program Files (x86)\Python37-32\lib\site-packages\numpy\core\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcndimage/_lib/_ccallback_c.c /Fobuild\temp.win32-3.7\Release\ndimage/_lib/_ccallback_c.obj
_ccallback_c.c
c1: **fatal error C1083: Cannot open source file: 'ndimage/_lib/_ccallback_c.c': No such file or directory**
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

Running Python v 3.7.4

Here is the downloadables, no 64-bit for Intel. python -m pip install --user ndimage-1.3.1-cp39-cp39-win32.whl gave me ERROR: ndimage-1.3.1-cp39-cp39-win32.whl is not a supported wheel on this platform. enter image description here

Upvotes: 0

Views: 1574

Answers (2)

Bhavya Parikh
Bhavya Parikh

Reputation: 3400

As you mention your python version 3.7 so you can check is it 64 bit or 32 bit by

(py37_64) E:\>python
Python 3.7.9 (default, Aug 31 2020, 17:10:11) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.

so from my environment is mention as 64 bit with python 3.7

Now for your platform python 3.7 so it should be ndimage‑1.3.1‑cp37‑cp37m‑win_amd64.whl or ndimage‑1.3.1‑cp37‑cp37m‑win32.whl

Why you are installing wheel file which contains for python 3.9 so that's why it giving platform not supported

Upvotes: 1

SuperStormer
SuperStormer

Reputation: 5387

That site is for windows binaries, as in the pre-built wheel files (.whl). Find the matching .whl file for your python version and 32/64 bit (e.g scipy‑1.6.3‑cp39‑cp39‑win_amd64.whl for scipy 1.6.3 for 64-bit Python 3.9). Then install it via pip install some_wheel_file.whl. This avoids needing to compile with a .tar.gz source distribution.

Edit: amd64 is for all 64-bit CPUs, not just AMD CPUs.

Upvotes: 0

Related Questions