简体   繁体   English

如何直接从命令提示符访问我用 Anaconda 安装的 Python?

[英]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.

相关问题 我如何访问随anaconda提示安装的vim? - How can I access the vim installed with the anaconda prompt? 如何从 Anaconda 提示符安装 Python 3.9? - How can I install Python 3.9 from the Anaconda prompt? 如何使用 Python 访问命令提示符历史记录 - How can I access command prompt history with Python 如何在Windows 10中从常规命令提示符处激活python anaconda并运行脚本 - How do I activate python anaconda and run script from regular command prompt in Windows 10 每当我在命令提示符下运行 python 时都会发出警告(我已经在我的 windows 8.1 操作系统上安装了 anaconda 最新版本) - Warning whenever i run python in my command prompt ( i have installed anaconda latest version on my windows 8.1 os) 如何让 anaconda 使用安装在我的系统上的 python3.9.2(64 位),但 Anaconda 将 python 3.8.8(32 位)作为默认使用? - How can I make anaconda use python3.9.2(64 bit) which is installed on my system but Anaconda gives python 3.8.8(32 bit) as default being used? 我怎么知道 anaconda 安装程序适用于哪个 python 版本? - How can I know a anaconda installer is for which python version? 如何从将运行 python 文件的命令提示符调用 bat 文件? - How do I call a bat file from command prompt which will run a python file? 如何在命令提示符下使用 anaconda python - how to use anaconda python in command prompt 如果我安装了 2 个 python 版本,如何在命令提示符中更改 python 版本 - How to change python version in command prompt if I have 2 python version installed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM