Проблемы при установке пакета edx-dl с помощью pip

Я хотел скачать несколько лекций с YouTube и edX, поэтому я взглянул на проект здесь:

https://github.com/coursera-dl/edx-dl

Я использую Python 3.4.3, как предложено в приведенной выше ссылке

$ python
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.

Сейчас я попробовал следующие команды:

  1. pip install youtube-dl

Результат был следующим:

[email protected]:~$ pip install youtube-dl
Downloading/unpacking youtube-dl
  Downloading youtube_dl-2016.7.24-py2.py3-none-any.whl (1.4MB): 1.4MB downloaded
Installing collected packages: youtube-dl
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 672, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 902, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 206, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 193, in clobber
    os.makedirs(destsubdir)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/youtube_dl-2016.7.24.dist-info'

Storing debug log for failure in /home/sparsh/.pip/pip.log
[email protected]:~$ pip install --upgrade youtube-dl
Downloading/unpacking youtube-dl
  Downloading youtube_dl-2016.7.24-py2.py3-none-any.whl (1.4MB): 1.4MB downloaded
Installing collected packages: youtube-dl
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 672, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 902, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 206, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 193, in clobber
    os.makedirs(destsubdir)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/youtube_dl-2016.7.24.dist-info'

Storing debug log for failure in /home/sparsh/.pip/pip.log
  1. Когда я попробовал команду:pip install edx-dl

Результат был следующим:

    [email protected]:~$ pip install edx-dl
Downloading/unpacking edx-dl
  Downloading edx-dl-0.1.2.tar.gz
  Running setup.py (path:/tmp/pip_build_sparsh/edx-dl/setup.py) egg_info for package edx-dl

Downloading/unpacking beautifulsoup4>=4.1.3 (from edx-dl)
  Downloading beautifulsoup4-4.5.0-py2-none-any.whl (83kB): 83kB downloaded
Downloading/unpacking html5lib>=1.0b2 (from edx-dl)
  Downloading html5lib-1.0b10.tar.gz (245kB): 245kB downloaded
  Running setup.py (path:/tmp/pip_build_sparsh/html5lib/setup.py) egg_info for package html5lib
    html5lib requires setuptools version 18.5 or above; please upgrade before installing (you have 3.3)
    Complete output from command python setup.py egg_info:
    html5lib requires setuptools version 18.5 or above; please upgrade before installing (you have 3.3)

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_sparsh/html5lib
Storing debug log for failure in /home/sparsh/.pip/pip.log

Пип версия

[email protected]:~$ pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)

Как я могу это исправить? Если есть лучший способ скачать лекции edX оптом, пожалуйста, поделитесь.

1 ответ

pip это файл python2 Чтобы использовать pip с python3: Установите и используйте pip3.

sudo apt install python3-pip ( provides /usr/bin/pip3 )

pip3 install youtube-dl
Другие вопросы по тегам