简体   繁体   English

pipenv 安装/pipenv shell 不适用于 Git Bash on Windows 10

[英]pipenv install/pipenv shell not working with Git Bash on Windows 10

I am having a hard time getting the pipenv install and pipenv shell commands to work when using Git Bash for Windows 10. When using powershell, I am able to successfully create a new virtual environment and use pipenv shell to enter the environment, but when using bash, nothing happens and it just proceeds to go to a flashing prompt.当使用 Git Bash for Windows 10 时,我很难让 pipenv install 和 pipenv shell 命令工作。使用 powershell 时,我能够成功创建新的虚拟环境并使用 pipenv 881186782419 bash,没有任何反应,它只是进入 go 并出现闪烁提示。

Bash recognizes other commands like pip list, but pipenv doesn't seem to be working for me. Bash 识别其他命令,如 pip 列表,但 pipenv 似乎对我不起作用。 I am very new to all of this so I may be missing something obvious, but I have searched for this issue to the best of my ability and even went through the pipenv documentation.我对所有这一切都很陌生,所以我可能会遗漏一些明显的东西,但我已经尽我所能搜索了这个问题,甚至浏览了 pipenv 文档。

My software versions are:我的软件版本是:

  • Windows 10 Home 21H1 Windows 10家21H1
  • git version 2.35.1 git 版本 2.35.1
  • bash version 4.4.23 bash 版本 4.4.23
  • Python 3.10.2 Python 3.10.2

Update: So I feel like an idiot, but am still left with a question.更新:所以我觉得自己像个白痴,但仍然有一个问题。 I have been fooling with this since yesterday and after posting, I remembered when I had installed a virtual environment using venv using the command 'python -m venv', so I tried running 'python -m pipenv install' and it worked.从昨天开始我就一直在玩弄这个,在发帖之后,我记得我使用命令“python -m venv”使用 venv 安装了一个虚拟环境,所以我尝试运行“python -m pipenv install”并且它成功了。 I also have to use 'python -m pipenv shell' to launch the shell.我还必须使用“python -m pipenv shell”来启动 shell。

Why do I have to do this?为什么我必须这样做? Every tutorial I've watched on setting up my environment and installing pipenv has just used pipenv install/shell.我看过的关于设置我的环境和安装 pipenv 的每个教程都只使用了 pipenv install/shell。

I just got the same issue and I doubt it's an issue in pipenv .我刚遇到同样的问题,我怀疑这是pipenv中的问题。

I resolve this by uninstalling the latest version 2022.1.8 of pipenv and install the version of 2021.5.29 , which is a working version on my another PC.我通过卸载最新版本的2022.1.8 pipenv并安装2021.5.29版本解决了这个问题,这是我另一台 PC 上的工作版本。

In case you don't know how to do this:如果您不知道该怎么做:

pip uninstall pipenv
pip install pipenv==2021.5.29

Update: after downgrade to 2021.5.29 , and then upgrade to the latest version, it still works.更新:降级到2021.5.29后,再升级到最新版本,还是可以的。 Now I have no idea what is the root cause.现在我不知道根本原因是什么。

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

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