【问题标题】:pipenv : The term 'pipenv' is not recognized as the name of a cmdletpipenv:术语“pipenv”未被识别为 cmdlet 的名称
【发布时间】:2020-07-21 18:29:20
【问题描述】:

我使用pip install pipenv 安装了pipenv,没有问题。

PS D:\GitHub\newhome.ca> pip install pipenv
Requirement already satisfied: pipenv in c:\users\hustler\appdata\roaming\python\python37\site-packages (2020.6.2)
Requirement already satisfied: virtualenv in c:\users\hustler\appdata\roaming\python\python37\site-packages (from pipenv) (20.0.27)
Requirement already satisfied: certifi in c:\users\hustler\appdata\roaming\python\python37\site-packages (from pipenv) (2020.6.20)
Requirement already satisfied: virtualenv-clone>=0.2.5 in c:\users\hustler\appdata\roaming\python\python37\site-packages (from pipenv) (0.5.4)
Requirement already satisfied: pip>=18.0 in c:\program files\python37\lib\site-packages (from pipenv) (18.1)
Requirement already satisfied: setuptools>=36.2.1 in c:\program files\python37\lib\site-packages (from pipenv) (40.6.2)
Requirement already satisfied: importlib-metadata<2,>=0.12; python_version < "3.8" in c:\users\hustler\appdata\roaming\python\python37\site-packages (from virtualenv->pipenv) (1.7.0)
Requirement already satisfied: six<2,>=1.9.0 in c:\users\hustler\appdata\roaming\python\python37\site-packages (from virtualenv->pipenv) (1.15.0)
Requirement already satisfied: distlib<1,>=0.3.1 in c:\users\hustler\appdata\roaming\python\python37\site-packages (from virtualenv->pipenv) (0.3.1)
Requirement already satisfied: appdirs<2,>=1.4.3 in c:\users\hustler\appdata\roaming\python\python37\site-packages (from virtualenv->pipenv) (1.4.4)
Requirement already satisfied: filelock<4,>=3.0.0 in c:\users\hustler\appdata\roaming\python\python37\site-packages (from virtualenv->pipenv) (3.0.12)
Requirement already satisfied: zipp>=0.5 in c:\users\hustler\appdata\roaming\python\python37\site-packages (from importlib-metadata<2,>=0.12; python_version < "3.8"->virtualenv->pipenv) (3.1.0)
You are using pip version 18.1, however version 20.2b1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

正如你在上面看到的,但是当我运行 pipenv --version 时,我得到了这个错误:

PS D:\GitHub\newhome.ca> pipenv --version

pipenv : The term 'pipenv' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ pipenv --version
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (pipenv:String) [], CommandNotFoundExcepti
   on
    + FullyQualifiedErrorId : CommandNotFoundException

我还在环境变量的路径中添加了pipenv的路径,即c:\users\hustler\appdata\roaming\python\python37\site-packages\pipenv,但仍然出现此错误。

【问题讨论】:

  • 不需要pipenv的路径,只需要..\PythonXX\Scripts\
  • 我认为它可能会有所帮助,因为之前有一条消息指出您应该将它添加到您的路径中,所以我做到了。我卸载然后重新安装。没有什么能正常工作
  • 已经安装好了,修复脚本路径后检查pipenv --version了吗?
  • 它已经安装了,但我做了一切它不起作用
  • 那么路径正确吗?转到脚本位置,看看你是否找到文件pipenv.py,如果在那里,则复制确切的路径并将其添加到环境路径变量中,记得删除旧的,或者你可以编辑旧的,在路径你应该有一个用于 Python,另一个用于脚本,它应该看起来像这样 `c:\users\hustler\appdata\roaming\python\python37\Scripts\`

标签: python virtualenv pipenv


【解决方案1】:

解决与此类似的错误的一个常见解决方案是将脚本文件夹的路径添加到您的路径并重新启动您的 powershell 会话。

路径应如下所示:C:\Users\user\AppData\Local\Programs\Python\Python37\Scripts

【讨论】:

  • 这可能有点矫枉过正,但您是否尝试过重新启动整个计算机?
【解决方案2】:

尝试在系统变量路径上添加脚本文件夹和站点包文件夹。

C:\Users\username\AppData\Roaming\Python\Python310\site-packages

C:\Users\username\AppData\Roaming\Python\Python310\Scripts

对我有用

【讨论】:

    猜你喜欢
    • 2019-10-12
    • 2017-12-11
    • 2021-12-09
    • 2020-02-25
    • 2020-04-17
    • 2018-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多