python - How to ensure that Spyder runs within a conda environment? -
i created conda environment called testenv
in windows 10 contains python 3.6 , spyder. installed selenium using method described in this answer. checked these packages installed with
conda list -n testenv
to run spyder in environment followed instructions in this answer , related comments. activated environment with
activate testenv
which modified prompt indicate testenv
active. typed
spyder
to launch spyder. (when spyder opens, command window automatically closes, , if open 1 without closing spyder, , issue command conda info -e
, output indicates testenv
no longer active.) @ point, when run code within spyder contains line
from selenium import webdriver
the spyder console reports
modulenotfounderror: no module named 'selenium'
my questions are:
is spyder running in testenv
? if so, why error being reported? if not, doing wrong?
edit: further research turned aptly-named thread "spyder not run in anaconda virtual environment on windows 10". followed suggestion, in accepted answer, of installing spyder after activating environment, returned message
# requested packages installed. # packages in environment @ c:\anaconda3\envs\testenv: # spyder 3.2.2 py36_0
one of answer's comments suggests using where spyder
within active environment check executables available. returned
c:\anaconda3\scripts\spyder.exe c:\anaconda3\envs\testenv\scripts\spyder.exe
so tried starting spyder typing full path of second entry. spyder opened, , program ran without errors. this seems have solved problem.
i issued command where spyder
within active environment check locations of spyder's executables. returned
c:\anaconda3\scripts\spyder.exe c:\anaconda3\envs\testenv\scripts\spyder.exe
so started spyder typing full path of second entry, , program ran without errors.
Comments
Post a Comment