How to get gi-cairo dependency for ns3

121 views
Skip to first unread message

Shamanth M

unread,
Oct 14, 2024, 3:49:24 PM10/14/24
to ns-3-users
I am setting up the ns3-allinone environment using bake. Once of the dependencies I require is gi-cairo. I have tried the following commands in my Ubuntu Python virtual environment:

sudo apt-get install python3-gi-cairo
pip install pycairo
pip install pygobject

These commands execute succesfully, but whenever I check the dependencies using ./bake.py show, the following text still shows up: 
 > gi-cairo - Missing
   >> Python gobject components missing from system.
   >> Try: "sudo apt-get install python3-gi-cairo", if you have sudo rights.


Any suggestions on what to do? 

Tommaso Pecorella

unread,
Oct 14, 2024, 5:48:51 PM10/14/24
to ns-3-users
Dunno if this might help, but beware of pip. If you have both Python2 and Python3 installed (common case for older systems), then pip will install the packages in the Python2 package area.
In my (now defunct) system, I had pip3 for Python3, but I have no idea if this is a standard thing or something that was in my system. In my actual Ubuntu machine pip and pip3 seems to be the same thing, so it shouldn't be the main issue.

Shamanth M

unread,
Oct 15, 2024, 9:53:18 AM10/15/24
to ns-3-users
Thank you for the response. 
I tried running using 'pip3 install' instead but it still says the package is missing. The same issue applies for the pygobject and the pygraphviz packages as well. 
I even ran 'pip3 list' to see all the packages installed on my virtual environment, but it shows that the packages are there: 
pycairo             1.27.0
PyGObject        3.50.0
pygraphviz        1.14


Even the sudo commands for these packages (eg 'sudo apt-get install python3-pygraphviz') will report that the package is present but the './bake.py show' command shows them as missing.

Tommaso Pecorella

unread,
Oct 15, 2024, 4:36:23 PM10/15/24
to ns-3-users
I can only guess since I don't use bake, and my guess is that it's looking for a specific version.

The good news is that these components should be (as far as I know) optional. The worst thing that can happen if you miss an optional library is that some features will be missing.
If I do remember well (again, not sure because it's not active in my system) these libraries are needed for the Visualizer module, and unless you want to use exactly that... well, you can also live without.

Shamanth M

unread,
Oct 17, 2024, 6:10:54 AM10/17/24
to ns-3-users
That's fine, I will proceed without these libraries for now. Thanks for your help!
Reply all
Reply to author
Forward
0 new messages