0

I have run into a problem while importing Scipy.

My OS is windows 10 enterprise. I have installed the latest Anaconda package (2022-10 64bit) in Jan of 2023. Everything was fine. And today I found I have trouble to run some code I created a few weeks ago. The problem is with SciPy. For example, with

from scipy import optimize

I got error

ImportError: DLL load failed while importing _interpolative: The specified procedure could not be found.

It happens to other Scipy modules such as scipy.integrate

From what I can remember, the only change I made recently was to install pywin32. Not sure if this is relevant. Also not sure if my company IT did any update to my system.

I have uninstalled Anaconda and reinsall twice. It did not help... Can anyone here help me out? Thank you very much.

P.S. following the suggestions from the replies, I tried

print(sys.executable)
print(sys.version)
print(os.getcwd())
print(getattr(os, "uname", lambda: None)())
print(sys.path)

And below is the results I got

C:\Users\span\Anaconda3\python.exe 3.9.13 (main, Aug 25 2022, 23:51:50) [MSC v.1916 64 bit (AMD64)] C:\Users\span None ['C:\Users\span', 'C:\Users\span\Anaconda3\python39.zip', 'C:\Users\span\Anaconda3\DLLs', 'C:\Users\span\Anaconda3\lib', 'C:\Users\span\Anaconda3', '', 'C:\Users\span\AppData\Roaming\Python\Python39\site-packages', 'C:\Users\span\Anaconda3\lib\site-packages', 'C:\Users\span\Anaconda3\lib\site-packages\win32', 'C:\Users\span\Anaconda3\lib\site-packages\win32\lib', 'C:\Users\span\Anaconda3\lib\site-packages\Pythonwin', 'C:\Users\span\Anaconda3\lib\site-packages\IPython\extensions', 'C:\Users\span\.ipython']

Shu Pan
  • 185
  • 2
  • 10
  • Could you run `import os` and `print(os.executable)` and see what path it prints out? It's possible you are not using the Anaconda python, but a different python executable. – Michael Cao Mar 07 '23 at 16:24
  • Thanks for the suggestion. I checked and it seems to be the right executable. C:\Users\ABC\Anaconda3\python.exe – Shu Pan Mar 07 '23 at 21:30
  • Add the whole traceback. [\[SO\]: PyCharm doesn't recognize installed module (@CristiFati's answer)](https://stackoverflow.com/a/73363599/4788546) – CristiFati Mar 08 '23 at 10:03
  • Tried but did not see anything wrong. Results updated in the main post – Shu Pan Mar 09 '23 at 03:52
  • Partly solved the problem by creating a new environment with only script installed. But th – Shu Pan Mar 10 '23 at 08:33
  • Partly solved the problem by creating a new environment and work under it. – Shu Pan Mar 10 '23 at 08:35

0 Answers0