anaconda - windows中的路径环境变量

时间:2021-12-24 11:23:02

I am trying to run python from the windows command prompt (windows 10). So the result is the typical one when the path environment variable is not configured

我试图从Windows命令提示符(Windows 10)运行python。因此,当未配置路径环境变量时,结果是典型的结果

 c:\windows\system32>python
'python' is not recognized as an internal or external command, operable
 program or batch file

however, I am not sure which is the right directory I should set up in the path variable.

但是,我不确定哪个是我应该在路径变量中设置的正确目录。

I tried a few variations, and none of them work, including:

我尝试了一些变化,但没有一个变化,包括:

c:\users\xxx\anaconda3
c:\users\xxx\anaconda3\Scripts
c:\users\xxx\anaconda3\libs\python34

and none of them works.

并且它们都不起作用。

Does anyone have experience with this particular system constellation (windows, anaconda). Thanks.

有没有人有这个特殊系统星座(windows,anaconda)的经验。谢谢。

5 个解决方案

#1


24  

it turns out I was mistaken.

事实证明我错了。

Solution is: in anaconda (as well as in other implementations), set the path environment variable to the directory where 'python.exe' is installed.

解决方案是:在anaconda(以及其他实现中)中,将路径环境变量设置为安装“python.exe”的目录。

As a default, the python.exe file in anaconda is in:

默认情况下,anaconda中的python.exe文件位于:

c:\.....\anaconda

after you do that, obviously, the python command works, in my case, yielding the following.

显然,在你这样做之后,python命令在我的情况下起作用,产生以下结果。

python
Python 3.4.3 |Anaconda 2.2.0. (64|bit)|(default, Nov 7 2015), etc, etc

#2


7  

It worked for me too.

它对我也有用。

I have trying to solve this problem since evening.

我从晚上起就试图解决这个问题。

Well coming to the point, instead of giving the path following way

好了到了这一点,而不是按照下面的方式给出路径

C:\Users\User_name\AppData\Local\Continuum\anaconda3\python.exe

do this

C:\Users\User_name\AppData\Local\Continuum\anaconda3\

#3


4  

C:\Users\\Anaconda3

I just added above path , to my path environment variables and it worked. Now, all we have to do is to move to the .py script location directory, open the cmd with that location and run to see the output.

我刚刚添加了上面的路径,我的路径环境变量,它工作。现在,我们所要做的就是移动到.py脚本位置目录,打开带有该位置的cmd并运行以查看输出。

#4


1  

In windows 10 you can find it here:

在Windows 10中,您可以在此处找到它:

C:\Users\[USER]\AppData\Local\conda\conda\envs\[ENVIRONMENT]\python.exe

#5


0  

C:\Users\<Username>\AppData\Local\Continuum\anaconda2

For me this was the default installation directory on Windows 7. Found it via Rusy's answer

对我来说,这是Windows 7上的默认安装目录。通过Rusy的回答找到它

#1


24  

it turns out I was mistaken.

事实证明我错了。

Solution is: in anaconda (as well as in other implementations), set the path environment variable to the directory where 'python.exe' is installed.

解决方案是:在anaconda(以及其他实现中)中,将路径环境变量设置为安装“python.exe”的目录。

As a default, the python.exe file in anaconda is in:

默认情况下,anaconda中的python.exe文件位于:

c:\.....\anaconda

after you do that, obviously, the python command works, in my case, yielding the following.

显然,在你这样做之后,python命令在我的情况下起作用,产生以下结果。

python
Python 3.4.3 |Anaconda 2.2.0. (64|bit)|(default, Nov 7 2015), etc, etc

#2


7  

It worked for me too.

它对我也有用。

I have trying to solve this problem since evening.

我从晚上起就试图解决这个问题。

Well coming to the point, instead of giving the path following way

好了到了这一点,而不是按照下面的方式给出路径

C:\Users\User_name\AppData\Local\Continuum\anaconda3\python.exe

do this

C:\Users\User_name\AppData\Local\Continuum\anaconda3\

#3


4  

C:\Users\\Anaconda3

I just added above path , to my path environment variables and it worked. Now, all we have to do is to move to the .py script location directory, open the cmd with that location and run to see the output.

我刚刚添加了上面的路径,我的路径环境变量,它工作。现在,我们所要做的就是移动到.py脚本位置目录,打开带有该位置的cmd并运行以查看输出。

#4


1  

In windows 10 you can find it here:

在Windows 10中,您可以在此处找到它:

C:\Users\[USER]\AppData\Local\conda\conda\envs\[ENVIRONMENT]\python.exe

#5


0  

C:\Users\<Username>\AppData\Local\Continuum\anaconda2

For me this was the default installation directory on Windows 7. Found it via Rusy's answer

对我来说,这是Windows 7上的默认安装目录。通过Rusy的回答找到它