4

I tried to install ipython notebook on my OS.But there was an error.How can I solve this?

sudo apt-get install ipython-notebook 

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ipython-notebook is not available, but is referred to by another packag. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'ipython-notebook' has no installation candidate

2
  • In some cases this problem can be solved by running the command apt-get update. because apt or apt-get doesn't know about what you're talking about and can be solved by updating. Let me know if it worked for you or not . Commented Aug 10, 2017 at 18:48
  • pip install ipython or sudo apt-get install ipython and similar things should go for python3 Commented Aug 10, 2017 at 18:51

4 Answers 4

5

Do you already have python installed? If so, try:

sudo apt-get install ipython

or if you have pip:

pip install ipython ipython-notebook

Regardless, I instead recommend installing Anaconda or Miniconda from:

https://www.continuum.io/downloads

This will help you setup virtual environments and packages.

Sign up to request clarification or add additional context in comments.

2 Comments

Anaconda contains all library that is useful.In IPython you have to install different-different libraries.
Doesn't work for me. I'm using Docker. Got this error: Could not find a version that satisfies the requirement ipython-notebook (from versions: ) No matching distribution found for ipython-notebook
5

I installed ipython via apt, and then went the pip and virtualenvwrapper route for ipython-notebook, which worked for me. The commands were:

sudo apt -y install ipython mkvirtualenv ipynb pip install ipython[notebook]

Alternatively:

sudo apt -y install ipython mkvirtualenv ipynb pip install ipython[all]

Comments

2

FWIW, I ran into this error when trying to run the following command on a freshly spun up Ubuntu 18 image (on AWS, ami-0ac019f4fcb7cb7e6):

sudo apt-get install ipython3 

E: Package 'ipython3' has no installation candidate

Running an apt-get update solved the problem. So:

sudo apt-get update sudo apt-get install ipython3 

Interestingly, I was surprised to find that this particular distro doesn't come with Python 2.7 installed, only Python3. That's probably AWS just trying to keep things light, which I appreciate.

Hopefully this helps someone down the line.

Comments

-1

As virtually every Linux distro, Ubuntu comes with Python 2.7 pre-installed. In order to execute your Python code, you open your terminal, cd to the directory where the script is and run python script.py

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.