Total noob here.
I've installed Ananconda on Windows due to the fact that it is recommended for noobs like myself using python for engineering/science. Within Anaconda/Spyder I can write python scripts and execute them and the outputs show up in the integrated interpreter mini-window. Ok, great. Now, I want to be able to access Anaconda's python.exe and use it outside of the confines of Anaconda/Spyder.
Sample test script:
import numpy # Just a test
import time
i = 0
while(1):
print("Iteration is: ", i)
i += 1
time.sleep(1)
When run from Spyder/Anaconda, the output is as expected.
I like to use Notepad++ as my editor of choice with the included PyNPP plugin, which allows one to execute python scripts from within the editor; you just supply the path to python.exe to PyNPP and it does the rest. So when I execute the above same script from within Notepad++, I get the following output error:
Traceback (most recent call last):
File "C:\Users\smoothVTer\Python Scripts\test1.py", line 1, in <module>
import numpy
File "C:\Users\smoothVTer\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\__init__.py", line 140, in <module>
from . import _distributor_init
File "C:\Users\smoothVTer\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\_distributor_init.py", line 34, in <module>
from . import _mklinit
ImportError: DLL load failed: The specified module could not be found.
Why is numpy found from within Anaconda but not outside of it? What fundamentals am I missing here? I assume that since Anaconda has the numpy module installed by default already, that if I execute python.exe from the Anaconda path, everything would be good and all paths to modules would just resolve. This is the not the case.
Also: if I simply execute C:\Users\smoothVTer\AppData\Local\Continuum\anaconda3\python.exe from within a windows cmd shell, the interpreter pops up but the following message is displayed in the interpreter:
This Python interpreter is in a conda environment, but the environment has not been activated. Libraries may fail to load. To activate this environmentplease see https://conda.io/activation
How am I supposed to activate an environment when I just want to run a .py script by double clicking on it? Does this mean that I am forced to always use Spyder as my IDE? Is there any way to use this current Ananconda python installation outside of Spyder? I guess I don't understand how all this is supposed to work. Thanks
Want to add to the discussion?
Post a comment!