SciPy is a library built on top of the NumPy extension. SciPy provides functions for algebraic, integration, and statistical calculations. You want to try using it and start installing, but you get an error message: “ModuleNotFoundError: No module named ‘scipy’ in Python”. Here is the solution for you.
Why does the “ModuleNotFoundError: No module named ‘scipy'” error occur?
We get the “ModuleNotFoundError: No module named ‘scipy'” error message because we did not install the SciPy package on our machine.
Besides that, there are some other reasons as follows:
- You work in a virtual environment but installed ‘scipy’ globally
- You named your module ‘scipy’ so that the official ‘SciPy’ module will be overwritten.
- You import ‘SciPy’ into your code, then accidentally name a variable as ‘scipy’. This action will make the import statement disabled.
The solution for this error
Assume that the pip module has been successfully installed on your machine. If you need help installing pip see the pip installation guide.
Fixing this error is very easy. You need to install the SciPy package on your computer precisely. But before doing this, I recommend you to check which version of python you are using.
Open the terminal and use this command:
python –-version
Output:
python 3.10.7
Then, install the SciPy package.
:: For Python 2. x version
pip install scipy
:: For Python 3. x version
pip3 install scipy
In some situations, you can edit the command as below, this command will help you to install ‘scipy’ in case pip does not exist in the PATH environment variables:
:: For Python 2. x version
python -m pip install scipy
:: For Python 3. x version
python3 -m pip install scipy
Now, let’s check if you have installed it successfully:
import scipy print('SciPy version: {}'.format(scipy.__version__))
Output:
SciPy version: 1.9.1
So you have successfully installed the SciPy package. We have solved the “ModuleNotFoundError: No module named ‘scipy’” error.
The last thing I want to remind you is to pay attention to your variable and module names, don’t name them as ‘scipy’ to avoid errors.
Summary
In conclusion, I showed you how to install SciPy on your computer with a straightforward command to fix the error ModuleNotFoundError: No module named ‘scipy’ in Python . I hope the information above is helpful to you.
Maybe you are interested:
- TypeError: unhashable type: ‘dict’ in Python
- ModuleNotFoundError: No module named ‘requests’
- TypeError: slice indices must be integers or None or have an __index__ method
- ModuleNotFoundError: No module named ‘tensorflow’ in python
- RuntimeError: dictionary changed size during iteration
- ModuleNotFoundError: No module named ‘skbuild’ in Python

My name’s Christopher Gonzalez. I graduated from HUST two years ago, and my major is IT. So I’m here to assist you in learning programming languages. If you have any questions about Python, JavaScript, TypeScript, Node.js, React.js, let’s contact me. I will back you up.
Name of the university: HUST
Major: IT
Programming Languages: Python, JavaScript, TypeScript, Node.js, React.js