Permission denied when trying to run pip install ipython

36,703

Solution 1

You can have both the default version of IPython from the default Ubuntu repositories and IPython 2.3.1 installed at the same time.

  1. Install IPython from the default Ubuntu repositories using the following command:

    sudo apt-get install ipython ipython3 # ipython is available in 18.04 and earlier
    
  2. Install IPython 2.3.1 in a virtual environment. virtualenv allows you to create a sandboxed and isolated environment where Python packages can be installed without interfering with other packages on the same machine. Install Python virtual environment creator (virtualenv):

    sudo apt-get install python-virtualenv virtualenv 
    

    Set up a virtual environment for Python (Information about virtualenv basic usage), activate your Python virtual environment from the terminal, and then install the current version of IPython using pip install.

    pip install --user ipython 
    

This is working on my Ubuntu 14.04 using IPython from the default Ubuntu repositories and IPython 2.3.0 installed inside a Python virtual environment (virtualenv).

Solution 2

I used this on Ubuntu 14.04.2 LTS.

Run the following command:

Install:

sudo apt-get install ipython3 ipython3-notebook

Startup:

sudo ipython3 notebook

Solution 3

First, you should enter as root:

sudo -i

and then run your command

pip install ipython
Share:
36,703

Related videos on Youtube

Flair
Author by

Flair

Updated on September 18, 2022

Comments

  • Flair
    Flair over 1 year

    When I used

    pip install ipython
    

    or

    pip install "ipython[notebook]"
    

    I get the following error:

    Downloading/unpacking ipython
      Downloading ipython-2.3.1-py27-none-any.whl (2.8MB): 2.8MB downloaded
    Installing collected packages: ipython
    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 1435, in install
        requirement.install(install_options, global_options, *args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/pip/req.py", line 671, in install
        self.move_wheel_files(self.source_dir, root=root)
      File "/usr/lib/python2.7/dist-packages/pip/req.py", line 901, 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/IPython'
    
    Storing debug log for failure in /home/username/.pip/pip.log
    

    What does this error mean? How do I fix it?

  • Flair
    Flair over 9 years
    What is the difference between the IPython from the Ubuntu Software Center and IPython 2.3.1?
  • karel
    karel over 9 years
    The principal milestones of IPython 2.0 are: interactive widgets for the IPython notebook (used by many people as a web-based user interface for numpy, scipy, and sympy), directory navigation in the notebook dashboard, persistent URLs for notebooks, a new modal user interface in the notebook and a security model for notebooks. IPython notebook export to pdf
  • Act DEV
    Act DEV over 7 years
    replace sudo ipython3 notebook with ipython3 notebook, sudo is not needed.
  • Samuel
    Samuel almost 7 years
    You probably don't want that, pip may install packages to the user's local directory: pip install --user ipython.
  • David Foerster
    David Foerster over 6 years
  • David Foerster
    David Foerster over 6 years