Installing anaconda to use with windows

2020-05-06 11:38发布

问题:

I am lost in the installation process of installing anaconda on windows.

I've installed the windows 32bit package (I'm running windows 7 x64)

I have anaconda in the start menu and I can open the python console and use scipy.stats.t.interval(), the function I am interested in.

However, how do I go about including this in another python program? I think it's something like adding it to the path. For instance, I have the scipy.stats.t.interval() function call in my other python file which I run through cygwin via python myscript.py. However it returns the error:

from scipy.stats import t
ImportError: No module named scipy.stats

I think it might be a change of path / add to path issue, but I'm not sure how to fix it :/. While I try to fix it, I figure I will post for help here.

回答1:

well you might have two installations of python, one inside the anaconda package, and other which you might have installed earlier. try doing :

which python

from CygWin console. If it returns:

/usr/bin

then it is definitely a add-to-path problem. to fix it for CygWin, you have to add the python installation from anaconda to the path.

try this fromn CygWin:

PATH=path-where-anaconda-is-installed/anaconda/bin:$PATH

and then doing:

which python 

should give you:

/path-to-anaconda/anaconda/bin

and then it will work.

Cheers