0

When I run any python script that imports numpy using Anaconda prompt it works fine, but when I run it using command line it gives me the following error: cmd error

I have searched online (link,link) but all similar questions have a filename conflict with an existing module which does not seem to be the case here.

Marij Khan
  • 151
  • 1
  • 12
  • Your PATHs are probably different between your anaconda prompt and the cmd prompt. While you are in your anaconda prompt, can you tell which exact python you are using? On Linux/Mac, you'd do a `which python` to find the first python on your $PATH, but I'm not sure of the equivalent in Windows. – Dave X May 02 '19 at 18:01
  • @DaveX Which path are you referring to? There's only one python installed. When running the windows equivalent of `which python` I get "C:\\Users\\marij\\Anaconda3" for both cmd and anaconda. – Marij Khan May 03 '19 at 09:10

1 Answers1

1

When you execute within anaconda environment (which is what the conda is), the path to the python is known within the env.

When you execute outside the conda env, you need to either have the Python in the system path, as an environment variable (windows), or however it is in Linux, or navigate to the Anaconda python.exe location

Otherwise, have alook here: NumPy library ImportError: DLL load failed: The specified procedure could not be found

Petronella
  • 2,327
  • 1
  • 15
  • 24
  • My python is in the system path that's why I don't get the error "python is not a recognized command" instead of the error I'm getting now even though I'm not in the folder where python is. – Marij Khan May 02 '19 at 10:54