如何使批处理文件在anaconda提示符下运行 [英] How to make batch files run in anaconda prompt

查看:578
本文介绍了如何使批处理文件在anaconda提示符下运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows中安装anaconda3后,我可以从anaconda提示符下运行python命令,但不能从Windows命令提示符下运行. 我想创建一个桌面快捷方式来激活我的环境并从中运行spyder.以前,我会使用.bat文件执行此操作,但是现在我无法从cmd.exe运行python命令,因此无法正常工作.

After installing anaconda3 in windows, I can run python commands from the anaconda prompt, but not from the windows command prompt. I would like to make a desktop shortcut to activate my environment and run spyder from it. Previously, I would do this with a .bat file, but now that I cannot run python commands from cmd.exe this doesn't work.

是否有另一种方法来运行anaconda提示符的批处理文件? 我知道我可以修改我的PATH以获得cmd.exe来运行python命令,但是如果可能的话,我想避免这种情况.

Is there an alternative way of running batch files for the anaconda prompt? I know that I could just modify my PATH to get cmd.exe to run python commands, but I'd like to avoid this if possible.

推荐答案

我相信Anaconda提示所做的只是打开CMD并运行批处理文件.输入脚本的第一个命令:

I believe all the Anaconda prompt does is open CMD and run a batch file. Make the first command of your script:

call <anaconda_dir>/Scripts/activate.bat <anaconda_dir>

这篇关于如何使批处理文件在anaconda提示符下运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆