Windows在尝试使用Pipenv安装软件包时报告错误 [英] Windows reports error when trying to install package using pipenv
问题描述
我按照此处的说明安装了pipenv.在Windows命令提示符下运行
I installed pipenv by following the instructions here. From the Windows command prompt I ran
pip install --user pipenv
返回了消息
Successfully installed pipenv-5.3.3
现在我想使用pipenv安装requests
软件包,所以我运行了
Now I want to install the requests
package using pipenv, so I ran
pipenv install requests
但这又回来了
'pipenv' is not recognized as an internal or external command,
operable program or batch file.
我已经添加了路径
C:\Users\Robert\AppData\Roaming\Python\Python35\site-packages
到我的Windows路径环境变量,但是我仍然收到相同的错误.
如何使用pipenv安装requests
软件包?
to my Windows path environment variable, but I still receive the same error.
How can I install the requests
package using pipenv?
由于我的系统上残留有Python 3.5和Python 3.6,因此我将卸载所有内容并重新开始. (我刚刚开始学习Python,我想让它尽可能简单.)
As I have remnants of Python 3.5 and Python 3.6 on my system, I'm going to uninstall everything and start anew. (I've just started learning Python and I want to keep this as simple as possible.)
推荐答案
我有类似的设置,并且遇到了类似的问题,但是我发现的解决方案非常简单.我所有的PATH变量都已经正确了(通过Python 3,Windows Installer会自动完成所有这些操作.)
I have a similar setup and faced a similar problem, but the solution I found was fairly simple. All of my PATH variables were already correct (from Python 3 the Windows Installer automatically does all of this).
实际上是由于 virtualenv 的冲突安装而引起的.
The problem actually arises because of conflicting installations of virtualenv.
要解决此问题,您只需运行以下命令:
To address this problem you need to simply run the following commands:
-
首先,删除当前版本的virtualenv:
pip uninstall virtualenv
然后,删除当前版本的pipenv:pip uninstall pipenv
Then, remove your current version of pipenv: pip uninstall pipenv
当询问您Proceed (y/n)?
时,只需输入y
.这会给你一个干净的状态.
When you are asked Proceed (y/n)?
just enter y
. This will give you a clean slate.
最后,您可以再次安装pipenv及其依赖项:pip install pipenv
Finally, you can once again install pipenv and its dependencies: pip install pipenv
这还将安装最新版本的 virtualenv .
This will also install the latest version of virtualenv.
只需在命令提示符下输入pipenv --version
,您应该会看到所需的输出.
Just enter pipenv --version
in the command prompt and you should see the desired output.
我知道这听起来很平凡,但这实际上是Windows系统的解决方案.您不需要修改任何系统环境变量(请不要将站点程序包添加到您的环境变量).
I know this sounds the mundane, but it is actually the solution for Windows systems. You do not need to modify any of your system environment variables (please do not add site-packages to your environment variables).
希望这会有所帮助!
这篇关于Windows在尝试使用Pipenv安装软件包时报告错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!