ModuleNotFoundError: No module named 'spatial'

5k Views Asked by At

I've been faced to Module Not Found Error in a script which all it's requirements has been installed. I'm trying to import spatial library:

import spatial

This library is located here: C:\Users\ASUS\AppData\Local\Programs\Python\Python37\Lib\site-packages\scipy\spatial

I checked installed packages through pip list and it was okay. I tried to install spatial-lib in Pycharm project environment but it couldn't be done:

Could not find a version that satisfies the requirement spatial-lib (from versions: ) No matching distribution found for spatial-lib You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

It's nonesence, because my pip is up-to-date. Maybe good to say, importing scipy has such probelms too.

1

There are 1 best solutions below

1
On BEST ANSWER

It looks like spatial is a sub-package of scipy. Therefore, to import spatial, you should use the following:

from scipy import spatial