【问题标题】:Why my visual studio code is not using pip package manager为什么我的 Visual Studio 代码没有使用 pip 包管理器
【发布时间】:2021-08-07 18:51:04
【问题描述】:

我已经有 Visual Studio 代码,但是当我在终端中使用 pip 播放声音命令时,它不起作用并出现此错误: pip :术语“pip”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者路径是否 包括,验证路径是否正确,然后重试。 在 line:1 char:1

  • 点播放声音
  •   + CategoryInfo          : ObjectNotFound: (pip:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException[![enter image description here][1]][1]
    
    
    [1]: https://i.stack.imgur.com/Fkbov.png
    

【问题讨论】:

    标签: python


    【解决方案1】:

    假设您使用的是 Python3.x 据我所知,playsound 不是 pip 接受的命令,但是,有一个用于播放同名声音的 pip 库(同样,假设您是这个意思)

    python3 -m pip install playsound 应该可以工作 当您使用它时,请检查您的 pip 是否已更新(如果没有,更新它的命令应该在您的 pip 命令末尾以黄色显示(如果有记忆的话)

    【讨论】:

      【解决方案2】:

      pip playsound 不是 pip 接受的命令。如您所见。

      15:02:33 in ~
      > pip
      
      Usage:
        pip3 <command> [options]
      
      Commands:
        install                     Install packages.
        download                    Download packages.
        uninstall                   Uninstall packages.
        freeze                      Output installed packages in requirements format.
        list                        List installed packages.
        show                        Show information about installed packages.
        check                       Verify installed packages have compatible dependencies.
        config                      Manage local and global configuration.
        search                      Search PyPI for packages.
        cache                       Inspect and manage pip's wheel cache.
        wheel                       Build wheels from your requirements.
        hash                        Compute hashes of package archives.
        completion                  A helper command used for command completion.
        debug                       Show information useful for debugging.
        help                        Show help for commands.
      
      General Options:
        -h, --help                  Show help.
        --isolated                  Run pip in an isolated mode, ignoring
                                    environment variables and user configuration.
        -v, --verbose               Give more output. Option is additive, and can be
                                    used up to 3 times.
        -V, --version               Show version and exit.
        -q, --quiet                 Give less output. Option is additive, and can be
                                    used up to 3 times (corresponding to WARNING,
                                    ERROR, and CRITICAL logging levels).
        --log <path>                Path to a verbose appending log.
        --no-input                  Disable prompting for input.
        --proxy <proxy>             Specify a proxy in the form
                                    [user:passwd@]proxy.server:port.
        --retries <retries>         Maximum number of retries each connection should
                                    attempt (default 5 times).
        --timeout <sec>             Set the socket timeout (default 15 seconds).
        --exists-action <action>    Default action when a path already exists:
                                    (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
        --trusted-host <hostname>   Mark this host or host:port pair as trusted,
                                    even though it does not have valid or any HTTPS.
        --cert <path>               Path to PEM-encoded CA certificate bundle. If
                                    provided, overrides the default. See 'SSL
                                    Certificate Verification' in pip documentation
                                    for more information.
        --client-cert <path>        Path to SSL client certificate, a single file
                                    containing the private key and the certificate
                                    in PEM format.
        --cache-dir <dir>           Store the cache data in <dir>.
        --no-cache-dir              Disable the cache.
        --disable-pip-version-check
                                    Don't periodically check PyPI to determine
                                    whether a new version of pip is available for
                                    download. Implied with --no-index.
        --no-color                  Suppress colored output.
        --no-python-version-warning
                                    Silence deprecation warnings for upcoming
                                    unsupported Pythons.
        --use-feature <feature>     Enable new functionality, that may be backward
                                    incompatible.
        --use-deprecated <feature>  Enable deprecated functionality, that will be
                                    removed in the future.
      
      15:02:36 in ~
      > pip playsound
      ERROR: unknown command "playsound"
      

      如果你想运行一个文件,那就是python &lt;filename&gt;

      【讨论】:

      • 感谢 Marf Bot 和 mrpbennett
      猜你喜欢
      • 2020-08-15
      • 1970-01-01
      • 1970-01-01
      • 2012-09-16
      • 2021-12-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多