2

I wanted to bulk download some lecture from YouTube and edX, so I took a look at the project here:

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

I am using Python 3.4.3 as suggested in the above link

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

Now I tried the following commands:

  1. pip install youtube-dl

The result was as follows:

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. When I tried the command: pip install edx-dl

The result was as follows:

    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

The pip version is

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

How can I fix this? If there is a better method to download the lectures of edX in bulk please share.

7
  • Why does your python run Python 3? That's not default behavior in Ubuntu.
    – edwinksl
    Jul 25, 2016 at 19:51
  • What is the output of pip --version? Jul 25, 2016 at 20:42
  • i changed it to python3 , for downloading it Jul 26, 2016 at 14:57
  • sparsh@sparsh-Inspiron-3558:~$ pip --version pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7) Jul 26, 2016 at 14:58
  • @SparshKansal Are you saying you changed /usr/bin/python to point to /usr/bin/python3 on your system?
    – edwinksl
    Jul 26, 2016 at 17:33

1 Answer 1

0

pip is a python2 file. To use pip with python3 : Install and use pip3.

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

pip3 install youtube-dl

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .