栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Python - pipx 无法将“pipx”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Python - pipx 无法将“pipx”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。

操作系统:Window 10 x64

根据 Installing stand alone command line tools 安装 pipx,重启 Powershell。但是,当我想查看 pipx 的帮助信息时,出现:

PS C:UsersAdmin> pipx --help
pipx : 无法将“pipx”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正
确,然后再试一次。
所在位置 行:1 字符: 1
+ pipx --help
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (pipx:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

后来发现,是因为没有将 Python 添加到环境变量中。

不过,奇怪的是,在此之前,我可以在 Powershell 或 cmd 中调用 Python。

将 Python 添加环境变量中即可:

重新打开 Powershell 输入 pipx --help 命令:

PS C:UsersAdmin> pipx --help
usage: pipx [-h] [--version]
            {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,completions}
            ...

Install and execute apps from Python packages.

Binaries can either be installed globally into isolated Virtual Environments
or run directly in a temporary Virtual Environment.

Virtual Environment location is C:UsersAdmin.localpipxvenvs.
Symlinks to apps are placed in C:UsersAdmin.localbin.

optional environment variables:
  PIPX_HOME             Overrides default pipx location. Virtual Environments will be
                        installed to $PIPX_HOME/venvs.
  PIPX_BIN_DIR          Overrides location of app installations. Apps are symlinked or
                        copied here.
  USE_EMOJI             Overrides emoji behavior. Default value varies based on platform.
  PIPX_DEFAULT_PYTHON   Overrides default python used for commands.

options:
  -h, --help            show this help message and exit
  --version             Print version and exit

subcommands:
  Get help for commands with pipx COMMAND --help

  {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,completions}
    install             Install a package
    inject              Install packages into an existing Virtual Environment
    upgrade             Upgrade a package
    upgrade-all         Upgrade all packages. Runs `pip install -U ` for each
                        package.
    uninstall           Uninstall a package
    uninstall-all       Uninstall all packages
    reinstall           Reinstall a package
    reinstall-all       Reinstall all packages
    list                List installed packages
    run                 Download the latest version of a package to a temporary virtual
                        environment, then run an app from it. Also compatible with local
                        `__pypackages__` directory (experimental).
    runpip              Run pip in an existing pipx-managed Virtual Environment
    ensurepath          Ensure directories necessary for pipx operation are in your PATH
                        environment variable.
    completions         Print instructions on enabling shell completions for pipx
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/307794.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号