How can I install Jupyter for Python 2.7 in Ubuntu 14.04?
I tried:
sudo add-apt-repository ppa:jolicloud-team/ppa
sudo apt-get update
The output for update:
Ign file: InRelease
Get:1 file: Release.gpg [181 B]
Get:2 file: Release [196 B]
Ign file: Translation-en_US
Ign file: Translation-en
Hit http://storage.googleapis.com stable InRelease
Ign http://us.archive.ubuntu.com trusty/universe Translation-en_US
Fetched 5,905 kB in 6s (915 kB/s)
W: Failed to fetch http://ppa.launchpad.net/jolicloud-team/ppa/ubuntu/dists/trusty/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/jolicloud-team/ppa/ubuntu/dists/trusty/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
and then:
sudo apt-get install jupiter
Output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package jupiter
Update:
mona@pascal:~/computer_vision/imgur$ sudo python -m pip install --upgrade --force-reinstall pip
The directory '/home/mona/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/mona/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pip
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 721kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Successfully installed pip-9.0.1
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
mona@pascal:~/computer_vision/imgur$ sudo -H pip install jupyter
Collecting jupyter
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading jupyter-1.0.0-py2.py3-none-any.whl
Collecting ipywidgets (from jupyter)
Downloading ipywidgets-5.2.2-py2.py3-none-any.whl (43kB)
100% |████████████████████████████████| 51kB 1.1MB/s
Collecting qtconsole (from jupyter)
Downloading qtconsole-4.2.1-py2.py3-none-any.whl (104kB)
100% |████████████████████████████████| 112kB 2.1MB/s
Collecting nbconvert (from jupyter)
Downloading nbconvert-4.2.0-py2.py3-none-any.whl (319kB)
100% |████████████████████████████████| 327kB 1.6MB/s
Collecting notebook (from jupyter)
Downloading notebook-4.2.3-py2.py3-none-any.whl (6.7MB)
100% |████████████████████████████████| 6.7MB 154kB/s
Collecting jupyter-console (from jupyter)
Downloading jupyter_console-5.0.0-py2.py3-none-any.whl
Collecting ipykernel (from jupyter)
Downloading ipykernel-4.5.0-py2.py3-none-any.whl (97kB)
100% |████████████████████████████████| 102kB 5.2MB/s
Collecting widgetsnbextension>=1.2.6 (from ipywidgets->jupyter)
Downloading widgetsnbextension-1.2.6-py2.py3-none-any.whl (1.5MB)
100% |████████████████████████████████| 1.5MB 674kB/s
Collecting ipython>=4.0.0 (from ipywidgets->jupyter)
Downloading ipython-5.1.0-py2-none-any.whl (747kB)
100% |████████████████████████████████| 747kB 1.2MB/s
Collecting traitlets>=4.2.1 (from ipywidgets->jupyter)
Downloading traitlets-4.3.1-py2.py3-none-any.whl (74kB)
100% |████████████████████████████████| 81kB 5.2MB/s
Collecting pygments (from qtconsole->jupyter)
Downloading Pygments-2.1.3-py2.py3-none-any.whl (755kB)
100% |████████████████████████████████| 757kB 1.2MB/s
Collecting jupyter-client>=4.1 (from qtconsole->jupyter)
Downloading jupyter_client-4.4.0-py2.py3-none-any.whl (76kB)
100% |████████████████████████████████| 81kB 5.0MB/s
Collecting jupyter-core (from qtconsole->jupyter)
Downloading jupyter_core-4.2.0-py2.py3-none-any.whl (76kB)
100% |████████████████████████████████| 81kB 5.4MB/s
Collecting entrypoints (from nbconvert->jupyter)
Downloading entrypoints-0.2.2-py2.py3-none-any.whl
Collecting nbformat (from nbconvert->jupyter)
Downloading nbformat-4.1.0-py2.py3-none-any.whl (140kB)
100% |████████████████████████████████| 143kB 4.0MB/s
Requirement already satisfied: jinja2 in /usr/lib/python2.7/dist-packages (from nbconvert->jupyter)
Collecting mistune!=0.6 (from nbconvert->jupyter)
Downloading mistune-0.7.3-py2.py3-none-any.whl
Collecting terminado>=0.3.3; sys_platform != "win32" (from notebook->jupyter)
Downloading terminado-0.6.tar.gz
Collecting tornado>=4 (from notebook->jupyter)
Downloading tornado-4.4.2.tar.gz (460kB)
100% |████████████████████████████████| 460kB 1.9MB/s
Collecting ipython-genutils (from notebook->jupyter)
Downloading ipython_genutils-0.1.0-py2.py3-none-any.whl
Collecting prompt-toolkit<2.0.0,>=1.0.0 (from jupyter-console->jupyter)
Downloading prompt_toolkit-1.0.9-py2-none-any.whl (241kB)
100% |████████████████████████████████| 245kB 2.7MB/s
Requirement already satisfied: decorator in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets->jupyter)
Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets->jupyter)
Collecting pickleshare (from ipython>=4.0.0->ipywidgets->jupyter)
Downloading pickleshare-0.7.4-py2.py3-none-any.whl
Collecting backports.shutil-get-terminal-size; python_version == "2.7" (from ipython>=4.0.0->ipywidgets->jupyter)
Downloading backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl
Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets->jupyter)
Collecting pathlib2; python_version == "2.7" or python_version == "3.3" (from ipython>=4.0.0->ipywidgets->jupyter)
Downloading pathlib2-2.1.0-py2.py3-none-any.whl
Requirement already satisfied: simplegeneric>0.8 in /usr/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets->jupyter)
Requirement already satisfied: six in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.2.1->ipywidgets->jupyter)
Collecting enum34; python_version == "2.7" (from traitlets>=4.2.1->ipywidgets->jupyter)
Downloading enum34-1.1.6-py2-none-any.whl
Requirement already satisfied: pyzmq>=13 in /usr/lib/python2.7/dist-packages (from jupyter-client>=4.1->qtconsole->jupyter)
Collecting configparser>=3.5; python_version == "2.7" (from entrypoints->nbconvert->jupyter)
Downloading configparser-3.5.0.tar.gz
Collecting jsonschema!=2.5.0,>=2.0 (from nbformat->nbconvert->jupyter)
Downloading jsonschema-2.5.1-py2.py3-none-any.whl
Requirement already satisfied: markupsafe in /usr/lib/python2.7/dist-packages (from jinja2->nbconvert->jupyter)
Collecting ptyprocess (from terminado>=0.3.3; sys_platform != "win32"->notebook->jupyter)
Downloading ptyprocess-0.5.1-py2.py3-none-any.whl
Collecting backports.ssl_match_hostname (from tornado>=4->notebook->jupyter)
Downloading backports.ssl_match_hostname-3.5.0.1.tar.gz
Collecting singledispatch (from tornado>=4->notebook->jupyter)
Downloading singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting certifi (from tornado>=4->notebook->jupyter)
Downloading certifi-2016.9.26-py2.py3-none-any.whl (377kB)
100% |████████████████████████████████| 378kB 2.1MB/s
Collecting backports_abc>=0.4 (from tornado>=4->notebook->jupyter)
Downloading backports_abc-0.4-py2.py3-none-any.whl
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter)
Downloading wcwidth-0.1.7-py2.py3-none-any.whl
Collecting functools32; python_version == "2.7" (from jsonschema!=2.5.0,>=2.0->nbformat->nbconvert->jupyter)
Downloading functools32-3.2.3-2.zip
Building wheels for collected packages: terminado, tornado, configparser, backports.ssl-match-hostname, functools32
Running setup.py bdist_wheel for terminado ... done
Stored in directory: /root/.cache/pip/wheels/3b/c2/ea/af635ffb63857a8c2ddd22da6a4b52f5b7ea3065db94ef5d7c
Running setup.py bdist_wheel for tornado ... done
Stored in directory: /root/.cache/pip/wheels/b3/db/47/46e05d1ee3ecfba252fcab42f0a156dab0df0cddf99fa0827c
Running setup.py bdist_wheel for configparser ... done
Stored in directory: /root/.cache/pip/wheels/1c/bd/b4/277af3f6c40645661b4cd1c21df26aca0f2e1e9714a1d4cda8
Running setup.py bdist_wheel for backports.ssl-match-hostname ... done
Stored in directory: /root/.cache/pip/wheels/5d/72/36/b2a31507b613967b728edc33378a5ff2ada0f62855b93c5ae1
Running setup.py bdist_wheel for functools32 ... done
Stored in directory: /root/.cache/pip/wheels/3c/d0/09/cd78d0ff4d6cfecfbd730782a7815a4571cd2cd4d2ed6e69d9
Successfully built terminado tornado configparser backports.ssl-match-hostname functools32
Installing collected packages: configparser, entrypoints, enum34, ipython-genutils, traitlets, functools32, jsonschema, jupyter-core, nbformat, pygments, mistune, nbconvert, ptyprocess, backports.ssl-match-hostname, singledispatch, certifi, backports-abc, tornado, terminado, jupyter-client, pathlib2, pickleshare, backports.shutil-get-terminal-size, wcwidth, prompt-toolkit, ipython, ipykernel, notebook, widgetsnbextension, ipywidgets, qtconsole, jupyter-console, jupyter
Found existing installation: tornado 3.1.1
DEPRECATION: Uninstalling a distutils installed project (tornado) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling tornado-3.1.1:
Successfully uninstalled tornado-3.1.1
Found existing installation: ipython 1.2.1
DEPRECATION: Uninstalling a distutils installed project (ipython) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling ipython-1.2.1:
Successfully uninstalled ipython-1.2.1
Rolling back uninstall of ipython
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 377, in move_wheel_files
clobber(source, dest, False, fixer=fixer, filter=filter)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 20] Not a directory: '/usr/local/share/man/man1/ipython.1.gz'
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
mona@pascal:~/computer_vision/imgur$ jupyter notebook
jupyter: 'notebook' is not a Jupyter command
mona@pascal:~/computer_vision/imgur$ jupyter
usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]
[--paths] [--json]
[subcommand]
jupyter: error: one of the arguments --version subcommand --config-dir --data-dir --runtime-dir --paths is required
mona@pascal:~/computer_vision/imgur$
Ubuntu 22.04 and later
Create
jupyter_notebook_config.py
by:Then open
~/.jupyter/jupyter_notebook_config.py
for editing in a text editor and change:to:
Don't forget to delete the
#
at the beginning of the line so it's not a comment anymore. You can use a different web browser if you don't like Web as long as it's not a snap package and you change the path from/usr/bin/epiphany
to the path to your web browser which you can find by running a command of the formwhich my-web-browser
.It still won't work though, so you have to do one more step. Change the ownership of the
~/.local/share/jupyter
directory from root to user. Instead of user in the below command replace it with your own username that you login with.Install Jupyter Notebook in Ubuntu 20.04 and later
Open the terminal and type:
Install Jupyter Notebook in Ubuntu 18.04→19.10
Open the terminal and type:
To start the notebook server run the following command:
You should see Jupyter Notebook open in your web browser.
Install Jupyter Notebook in Ubuntu 17.04 and 17.10
In Ubuntu 17.04 and later Jupyter Notebook is available in the default Ubuntu repositories and can be quickly and easily installed using apt. Open the terminal and type:
python-ipykernel is necessary for running Python 2.x programs in Jupyter Notebook, which otherwise supports only Python 3.x.
To start the notebook server run the following command:
You should see Jupyter Notebook open in your web browser.
Install Jupyter Notebook in Ubuntu 14.04→16.10
The default version of Python in Ubuntu works OK, but pip needs to be updated to the latest version.
If you are using Python 3.x, run these commands instead:
To start Jupyter Notebook, run the following command:
If you also have python-matplotlib installed, the first line of code to enable plotting in the current Notebook is
%matplotlib inline
It is possible to use Python 3 in Jupyter Notebook for Python 2 by adding the kernel for Python 2. If you're running Jupyter on Python 3, you can set up a Python 2 kernel like this: