【问题标题】:Problem downloading (pytube) library in Python在 Python 中下载(pytube)库时出现问题
【发布时间】:2021-03-31 17:35:40
【问题描述】:

我想从名为 (pytube) 的 Python 库中下载一个库 当我将下载命令 [pip install git + https://github.com/pytube/pytube] 放到 cmd 面板中时,会出现如下输出:

Collecting git+https://github.com/pytube/pytube
  Cloning https://github.com/pytube/pytube to c:\users\jit\appdata\local\temp\pip-req-build-w3q3fwqn

Requirement already satisfied (use --upgrade to upgrade): pytube==10.6.1 from git+https://github.com/pytube/pytube in c:\users\jit\appdata\local\programs\python\python39\lib\site-packages
Using legacy 'setup.py install' for pytube, since package 'wheel' is not installed.

WARNING: You are using pip version 20.2.3; however, version 21.0.1 is available.
You should consider upgrading via the 'c:\users\jit\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.

于是我将提示[pip install --upgrade pip] 写入cmd面板,得到如下输出:

Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.2.3
    Uninstalling pip-20.2.3:
      Successfully uninstalled pip-20.2.3
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Users\\jit\\AppData\\Local\\Temp\\pip-uninstall-pnqylmmj\\pip.exe'
Consider using the `--user` option or check the permissions.

说明图: https://suar.me/ve9J0

在另一次尝试安装它时,我在 (PyCharm) 程序内的 (Terminal) 中键入了命令:

Collecting git+https://github.com/pytube/pytube
  Cloning https://github.com/pytube/pytube to c:\users\jit\appdata\local\temp\pip-req-build-o5uke_cl
  Running command git clone -q https://github.com/pytube/pytube 'C:\Users\jit\AppData\Local\Temp\pip-req-build-o5uke_cl'

说明图: https://suar.me/OZYPG

而且我没有成功安装库!这是为什么?我该如何解决?

【问题讨论】:

    标签: python terminal module libraries pytube


    【解决方案1】:

    尝试安装 pytube3。 pip install pytube3

    对于 pip 警告,它只是一个警告,因为您没有使用最新版本,请使用此命令对其进行升级:python -m pip install --upgrade pip

    【讨论】:

      【解决方案2】:

      欢迎来到 Stackoverflow!!!

      对于已安装的pytube,请尝试升级到最新版本pytube-10.6.1

      python -m pip install --upgrade pytube
      

      对于pip install --upgrade pip 错误,这是由于访问权限不足:

      ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Users\\jit\\AppData\\Local\\Temp\\pip-uninstall-pnqylmmj\\pip.exe'
      

      解决方案:

      Consider using the `--user` option or check the permissions.
      

      试试:

      python -m pip install --upgrade pip --user
      

      或者以管理员身份打开命令提示符并执行相同的命令。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-09-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-03-19
        • 2015-05-03
        • 2021-09-07
        相关资源
        最近更新 更多