Cannot open GNS3 after installing Virt-manager

GNS3 Version: GNS3 v2.2.34
Operating System: Manjaro Linux (Kernel 5.19.16-2-MANJARO)

Hi. I’m having problem opening GNS3. It was working fine a few days ago. The last thing I did was install virt-manager; after that I tried to open GNS3 and there goes the issue (screenshot below)

I already tried restoring using timeshift with my backup from a month ago; but no luck, the problem still persist. Please help. I’m currently working on my certification. Appreciate the help.

GNS3 management console.
Running GNS3 version 2.2.34 on Linux (64-bit) with Python 3.10.7 Qt 5.15.6 and PyQt 5.15.7.
Copyright (c) 2006-2022 GNS3 Technologies.
Use Help -> GNS3 Doctor to detect common issues.

=> Local server process has stopped
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 581, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 909, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 800, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (charset-normalizer 3.0.0 (/usr/lib/python3.10/site-packages), Requirement.parse('charset-normalizer<3.0,>=2.0'), {'aiohttp'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/gns3server", line 33, in <module>
    sys.exit(load_entry_point('gns3-server==2.2.34', 'console_scripts', 'gns3server')())
  File "/usr/bin/gns3server", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.10/site-packages/gns3server/main.py", line 29, in <module>
    import gns3server.utils.get_resource
  File "/usr/lib/python3.10/site-packages/gns3server/utils/get_resource.py", line 19, in <module>
    import pkg_resources
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3260, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3272, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 596, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 795, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'charset-normalizer<3.0,>=2.0' distribution was not found and is required by aiohttp

Do you think I’m going to zoom this image so I can see what the hell it says? Use preformatted text.

Seriously, uploading images should be banned.

There are multiple packages with names starting with gns3.

All of them are AUR packages.

AUR (en) - Packages

If you installed something (virt-manager) then usually the system is also updated.

This may require you to have to rebuild your gns package (all AUR packages in general).

I cannot make heads or tails of the error messages - not helpful to me. :wink:

Sorry, my bad. I’ve edited the post. Errors are from the GNS3-Console window

Thanks for the reply. I’ve installed virt-manager before updating the system; then the problem occured. I’ve tried restoring from my backup a month ago using timeshift, after restoring, I’ve also tried updating my whole system first; then installing virt-manager again, but the issue still persist. I’ve also tried rebuilding the GNS3 package, same problem.

virt-manager installation just so happens to be installed at the same time, but it’s not the cause.

Usually it’s either a missing package, or even more common with GNS3 - a newer version of system package than in requirements.txt. You can see that on the last line:

DistributionNotFound: The 'charset-normalizer<3.0,>=2.0'
$ pacman -Q python-charset-normalizer
python-charset-normalizer 3.0.0-1

So you can try editing correct PKGBUILD (sometimes both -gui and -server needs the edit - check which one depends on charset-normalizer) and just add another sed line, changing required version.
You’ll see there are already other packages edited like that.

…anyways…

I wrote above before I went and check it myself. This won’t work this time, because it’s another package (python-aiohttp) that needs 'charset-normalizer<3.0,>=2.0' - it also says so in the last error message…if I would scroll to the right. :smiley:

So we could try editing python-aiohttp PKGBUILD and remove that requirement (setup.cfg:52: charset-normalizer >=2.0, < 3.0) and hope it would still work, which it probably wouldn’t.

So easiest for now is to just wait for new python-aiohttp version that will support python-charset-normalizer>=3.0 and until then downgrade to python-charset-normalizer 2.1.1. If you don’t have that version in cache anymore, then just install it from archlinux archive.

You should also open a bug report on arch bugtracker. (done)

1 Like

I found this solution and it worked on my system i was facing the same issue hopefully this will help you

pip uninstall gns3-gui
pip uninstall gns3-server
pip install gns3-gui
pip install gns3-server
1 Like

Just don’t open new posts here when you won’t be able to update your system, because you are stupidly using sudo pip.

It worked! Thanks man! You’re a life-saver!

@zbe is right though; I also learned the hard-way not to run pip as sudo.

Thanks, man. I’ve tried @raxor64 comment and it worked; this is also the solution I’ve received just now in GNS3 Forum. Appreciate the help.

Thanks for correcting me @zbe

1 Like

Apparently ‘<3.0’ requirement is arbitrary.

So a simple sed magically fixes everything, lolz. (have fun with pip) :stuck_out_tongue:

sed -i 's/charset-normalizer (<3.0,>=2.0)/charset-normalizer (<4.0,>=2.0)/' /usr/lib/python3.10/site-packages/aiohttp-3.8.3.dist-info/METADATA
1 Like