简体   繁体   English

"Python 在 git bash 上的 conda 环境中运行时挂起"

[英]Python hangs when running in a conda env on git bash

I want to use my conda environment in gitbash.我想在 gitbash 中使用我的 conda 环境。 I have add my conda.sh path in my ~\/.bashrc.我在 ~\/.bashrc 中添加了我的 conda.sh 路径。 This is correctly recognized as I can now run conda activate<\/code> and the base<\/code> environment will be activated.这是正确识别的,因为我现在可以运行conda activate<\/code>并且将激活base<\/code>环境。 Now I can run command such as pip install jupyterlab<\/code> and it will correctly run.现在我可以运行诸如pip install jupyterlab<\/code>之类的命令,它会正确运行。 However, when I type python<\/code> the terminal just hangs indefinitely.但是,当我键入python<\/code>时,终端只是无限期地挂起。 which python<\/code> correctly returns \/c\/Users\/valer\/anaconda3\/python<\/code> . which python<\/code>正确返回\/c\/Users\/valer\/anaconda3\/python<\/code> 。 Similarly, the Anaconda Prompt returns to where python<\/code> : C:\\Users\\valer\\anaconda3\\python.exe<\/code> If I type python<\/code> through the Anaconda Prompt it works normally.同样,Anaconda Prompt 返回到where python<\/code>的位置: C:\\Users\\valer\\anaconda3\\python.exe<\/code>如果我通过 Anaconda Prompt 键入python<\/code> ,它可以正常工作。 Any idea?任何的想法?

"

I have the same problem.我也有同样的问题。 In addition to your story, I'm able to run scripts.除了你的故事,我还能运行脚本。

So, this hangs:所以,这挂起:

$ python

But this works:但这有效:

$ python script.py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM