[英]How to get into an active Python Virtual Environment from Git Bash
I have a Python virtual environment with a cloned Github repository inside of it. 我有一个Python虚拟环境,其中包含一个克隆的Github存储库。 The repository requires me to run a .sh file.
存储库要求我运行.sh文件。 I am using GitBash to run the
sh setup.sh
command. 我正在使用GitBash运行
sh setup.sh
命令。
When I run the .sh file, I get a huge list of "command not found" errors which I think are coming from the fact that my GitBash is not operating in the virtual environment which I activated originally. 运行.sh文件时,我看到大量的“找不到命令”错误,我认为这是由于我的GitBash不在我最初激活的虚拟环境中运行这一事实所致。 When I type
$ source ./EnvironmentName.env/bin/activate
into the GitBash, it tells me that there is "No such file or directory". 当我在GitBash中键入
$ source ./EnvironmentName.env/bin/activate
,它告诉我“没有这样的文件或目录”。
How do I activate the original environment in my GitBash window? 如何在GitBash窗口中激活原始环境?
如果您使用的是Windows,则将创建“脚本”文件夹而不是“ bin”,则命令应如下所示:
$ source ./EnvironmentName.env/Scripts/activate
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.