0

I'm trying to install ns3 and, before that, I need to run the command below:

sudo apt install gir1.2-goocanvas-2.0 python-gi python-gi-cairo python-pygraphviz python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython ipython3

After running this command, I get this error:

The following packages have unmet dependencies:
 ipython : Depends: python-ipython (= 5.5.0-1) but it is not going to be installed
 python-gi : Depends: python2 (< 2.8) but it is not going to be installed
             Depends: python2 (>= 2.7~) but it is not going to be installed
             Depends: python2:any (< 2.8)
             Depends: python2:any (>= 2.7~)
 python-gi-cairo : Depends: python-cairo (>= 1.11.1) but it is not going to be installed
                   Depends: python2 (< 2.8) but it is not going to be installed
                   Depends: python2 (>= 2.7~) but it is not going to be installed
                   Depends: python2:any (< 2.8)
                   Depends: python2:any (>= 2.7~)
E: Unable to correct problems, you have held broken packages.

What should I do to solve this problem?

2 Answers2

0

If by ns3 you mean the ns-3 network simulator, there's some guidance on installing it on Ubuntu on their wiki.

It looks like a long list of pre-requisites, but they publish the exact commands you need.

https://www.nsnam.org/wiki/Installation#Ubuntu.2FDebian.2FMint

But please edit your question and indicate what version of Ubuntu you are using, because what you need to do may vary.

Also, the website mentions python (which in older releases means python2) and python3. Their software is in transition.

mondotofu
  • 777
0

First, make sure you run the command

sudo apt update 

Then, run the command

sudo apt install gir1.2-goocanvas-2.0 python-gi python-gi-cairo python-pygraphviz python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython ipython3

If it gives the same error, then install python-pip and python3-pip using

sudo apt install python-pip python3-pip

Once done, install ipython via pip

sudo -H pip install ipython 
sudo -H pip3 install ipython

Finally, run

sudo apt install gir1.2-goocanvas-2.0 python-gi python-gi-cairo python-pygraphviz python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0
Tejas Lotlikar
  • 2,945
  • 5
  • 17
  • 26