Python Forum
ModuleNotFoundError: No module named 'scipy.optimize'; 'scipy' is not a package
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ModuleNotFoundError: No module named 'scipy.optimize'; 'scipy' is not a package
#2
You probably have a file called "scipy.py" in your PYTHONPATH (such as the current directory). It is overriding the interpreter's search for the actual scipy package.

Rename the file so it doesn't conflict.

Output:
$ python -c 'from scipy.optimize import brentq; print("ok")' ok $ touch scipy.py $ python -c 'from scipy.optimize import brentq; print("ok")' Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'scipy.optimize'; 'scipy' is not a package
Reply


Messages In This Thread
RE: ModuleNotFoundError: No module named 'scipy.optimize'; 'scipy' is not a package - by bowlofred - Jul-09-2020, 02:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  ModuleNotFoundError: No module named 'bluetooth' Error Rovelin 4 308 Aug-31-2021, 04:04 PM
Last Post: Rovelin
  Using curve_fit to optimize function (TypeError) Laplace12 4 279 Aug-30-2021, 11:15 AM
Last Post: Larz60+
  Scipy sparse setuptools issues Anldra12 11 732 Jun-19-2021, 04:01 PM
Last Post: Anldra12
  No module named 'pysolar' - even tough pysolar is installed - What am I doing wrong? Jghurt 5 839 May-08-2021, 07:03 PM
Last Post: Jghurt
  ModuleNotFoundError: No module named 'graph' Anldra12 3 1,528 May-02-2021, 02:41 PM
Last Post: Anldra12
  ModuleNotFoundError: No module named 'fpdf' KatMac 4 1,813 Apr-19-2021, 01:23 PM
Last Post: KatMac
  Optimize a game of life (4 sec for python when 6 ms for C version !) fatango 0 438 Jan-06-2021, 09:13 PM
Last Post: fatango
  ModuleNotFoundError: No module named 'com' aleksg 9 2,592 Dec-14-2020, 05:00 PM
Last Post: Larz60+
Video ModuleNotFoundError: No module named ‘…’ Frank911 1 1,473 Dec-11-2020, 03:59 PM
Last Post: michael1789
  no module named finbert found ErnestTBass 4 1,330 Dec-05-2020, 06:09 PM
Last Post: andrianas

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020