[英]How can I access Python which I installed with Anaconda directly from command prompt?
I installed Python 3.7.0 with Anaconda 5.3.0.我用 Anaconda 5.3.0 安装了 Python 3.7.0。 I could run the python prompt directly from Windows' command prompt by typing "python" or "python3" when I installed it by itself but installed this way, I can only access it from Anaconda command prompt which also I cannot run directly from Windows' cmd.我可以通过在自己安装时键入“python”或“python3”直接从 Windows 的命令提示符运行 python 提示符,但以这种方式安装,我只能从 Anaconda 命令提示符访问它,我也不能直接从 Windows 运行指令。 How can I access python and/or anaconda(if possible) directly from cmd?如何直接从 cmd 访问 python 和/或 anaconda(如果可能)?
You should check where is your Anaconda path.您应该检查您的 Anaconda 路径在哪里。 In Windows 10, you can commonly find it in:在 Windows 10 中,您通常可以在以下位置找到它:
C:\\Users\\<user_name>\\AppData\\Local\\conda\\conda\\envs\\<name_of_env>\\python.exe
You can simply call this from cmd
or add it to your user/system variables so it's easier to access.您可以简单地从cmd
调用它或将其添加到您的用户/系统变量中,以便更容易访问。 For doing this in Windows 10: Press Win+X
, then Y
, then search for Environment variables
and click the option that says Edit environment variables for your account
.要在 Windows 10 中执行此操作:按Win+X
,然后按Y
,然后搜索Environment variables
并单击显示Edit environment variables for your account
的选项。 Then, set variable PYTHONPATH
to your Anaconda environment.然后,将变量PYTHONPATH
设置为您的 Anaconda 环境。 Another way to do this:另一种方法来做到这一点:
set PYTHONPATH=%PYTHONPATH%;C:\<path_to_your_env>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.