How to solve: ModuleNotFoundError: No module named 'scipy'

To fix ModuleNotFoundError: No module named 'scipy'the error, you need to install the SciPy module. Here are some workarounds:

  1. Install using pip: Run the following command in Command Prompt (Windows) or Terminal (Linux/macOS) to install SciPy using pip:

    pip install scipy

    This will download and install the SciPy module and its dependencies from the Python Package Index (PyPI).

  2. Install using conda: If you are using the Anaconda distribution, you can try using conda to install SciPy. Run the following command in a command prompt or terminal: conda install scipy
    This will install SciPy using precompiled packages from the Anaconda repository.

  3. Check the Python environment: Make sure you are using the correct Python environment. Sometimes, if you have multiple Python versions or virtual environments, it can cause modules not to be found. Make sure to install and run the code in the correct environment.

  4. Update pip and conda: If you already have pip and conda installed, try updating them to the latest versions, then try installing SciPy again.

    For pip, run the following command: pip install --upgrade pip

    For conda, run the following command: conda update conda

 Hope to help you, thank you~

Guess you like

Origin blog.csdn.net/Along_168163/article/details/131960438