Problemas ao instalar o pacote edx-dl com pip

2

Eu queria fazer o download em massa de algumas palestras do YouTube e do edX, então dei uma olhada no projeto aqui:

link

Estou usando o Python 3.4.3, conforme sugerido no link acima

$ 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.

Agora eu tentei os seguintes comandos:

  1. pip install youtube-dl

O resultado foi o seguinte:

sparsh@sparsh-Inspiron-3558:~$ 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
sparsh@sparsh-Inspiron-3558:~$ 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. Quando eu tentei o comando: %código%

O resultado foi o seguinte:

    sparsh@sparsh-Inspiron-3558:~$ 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

A versão do pip é

sparsh@sparsh-Inspiron-3558:~$ pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)

Como posso consertar isso? Se houver um método melhor para baixar as palestras do edX em massa, por favor, compartilhe.

    
por Sparsh Kansal 25.07.2016 / 21:22

1 resposta

0

pip é um arquivo python2. Para usar o pip com python3: Instale e use o pip3.

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

pip3 install youtube-dl
    
por Knud Larsen 26.07.2016 / 19:27