GNS3 can't find installed python package

I’ve installed GNS3, but I’m getting this error when I start it:

Traceback (most recent call last):
  File "/usr/bin/gns3", line 33, in <module>
    sys.exit(load_entry_point('gns3-gui==2.2.33.1', 'gui_scripts', 'gns3')())
  File "/usr/bin/gns3", 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/gns3/main.py", line 40, in <module>
    from gns3.utils.get_resource import get_resource
  File "/usr/lib/python3.10/site-packages/gns3/utils/get_resource.py", line 21, in <module>
    import pkg_resources
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3317, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3291, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3329, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 573, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 891, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pyrsistent>=0.14.0' distribution was not found and is required by jsonschema

But I have this package installed:

pacman -Q python-pyrsistent
python-pyrsistent 0.18.1-1

Weird. Does reinstalling python-pyrsistent and python-jsonschema make any difference?

none, the error keeps happening

gns3- what?

gns-gui depends on python-python-jsonschema and python-jsonschema depends on python-pyrsistent, so there’s no reason this should be happening–if you installed gns-gui properly with makepkg or an AUR Helper like Pamac or Yay with it’s included dependencies, that is.

What’s the output of:

which python

If you have Pip installed (which I’m guessing you do), show us where these modules are installed:

pip show jsonschema pyrsistent | grep Location

So, I’ve installed GNS3 both gns3-gui and gs3-server with yay and the pacman packages came python-jsonschema and python-pyrsistent, but they were installed through the arch repositories, doesn’t seem to have been installed through pip.

When I run pacman -Q python-jsonschema or pacman -Q python-pyrsistent both of them are shown as installed.

pacman -Q python-pyrsistent                                                                                                                                                                                
python-pyrsistent 0.18.1-1
pacman -Q python-jsonschema                                                                                                                                                                                
python-jsonschema 3.2.0-6

Now to answer your questions:

which python                                                                                                                                                                                               
/usr/bin/python
pip show jsonschema pyrsistent | grep Location                                                                                                                                                             
WARNING: Package(s) not found: pyrsistent
Location: /usr/lib/python3.10/site-packages

Well, there you go. That was what the original error message stated. Reinstall python-jsonschema to make sure all it’s dependencies are also reinstalled:

sudo pacman -Syu python-jsonschema

Ok, I did it, then nothing change with gs3. also the responses to pip show jsonschema pyrsistent | grep Location didn’t changed.

I noticed that only python-jsonschema was been installed. So I tried to reinstall python-pyrsistent, then this happened.

:: Sincronizando a base de dados de pacotes...
 core está atualizado
 extra está atualizado
 community está atualizado
 multilib está atualizado
atenção: python-pyrsistent-0.18.1-1 está atualizado -- reinstalando
:: Iniciando atualização completa do sistema...
resolvendo dependências...
procurando pacotes conflitantes...

Pacotes (1) python-pyrsistent-0.18.1-1

Tamanho total instalado:  0,48 MiB
Alteração no tamanho:     0,00 MiB

:: Continuar a instalação? [S/n] 
(1/1) verificando chaves no chaveiro                                                                                           [############################################################################] 100%
(1/1) verificando integridade do pacote                                                                                        [############################################################################] 100%
(1/1) carregando arquivos do pacote                                                                                            [############################################################################] 100%
(1/1) verificando conflitos de arquivos                                                                                        [############################################################################] 100%
(1/1) verificando espaço em disco disponível                                                                                   [############################################################################] 100%
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/__pycache__/_pyrsistent_version.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/_pyrsistent_version.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent-0.18.1-py3.10.egg-info/
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent-0.18.1-py3.10.egg-info/PKG-INFO
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent-0.18.1-py3.10.egg-info/SOURCES.txt
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent-0.18.1-py3.10.egg-info/dependency_links.txt
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent-0.18.1-py3.10.egg-info/top_level.txt
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__init__.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__init__.pyi
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/__init__.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/__init__.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_checked_types.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_checked_types.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_field_common.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_field_common.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_helpers.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_helpers.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_immutable.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_immutable.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pbag.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pbag.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pclass.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pclass.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pdeque.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pdeque.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_plist.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_plist.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pmap.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pmap.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_precord.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_precord.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pset.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pset.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pvector.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_pvector.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_toolz.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_toolz.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_transformations.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/_transformations.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/typing.cpython-310.opt-1.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/__pycache__/typing.cpython-310.pyc
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_checked_types.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_field_common.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_helpers.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_immutable.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_pbag.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_pclass.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_pdeque.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_plist.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_pmap.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_precord.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_pset.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_pvector.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_toolz.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/_transformations.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/py.typed
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/typing.py
atenção: não foi possível obter informações do arquivo usr/lib/python3.10/site-packages/pyrsistent/typing.pyi
:: Processando alterações do pacote...
(1/1) reinstalando python-pyrsistent                                                                                           [############################################################################] 100%
:: Executando hooks pós-transação...
(1/1) Arming ConditionNeedsUpdate...

It is in brazilian portuguese, atenção: não foi possível obter informações do arquivo... means atention: can't obtein informations from file... the pyrsistent still shown as installed with pacman -Q, but as I said in the begining, nothing changed with gns3, how can I fix this?

Tell me how the first time, when I asked you to reinstall it, it was “none, the error keeps happening” and the second time, magically, there are these pacman errors.

You used sudo pip install pyrsistent at some point, that’s why there are conflicting files. Never do that.

Reinstall python-pyrsistent overwriting the existing files. This step should never have to be done normally:

sudo pacman -S python-pyrsistent --overwrite /usr/lib/python3.10/site-packages/\*

Please prefix terminal commands you plan to paste here with LC_ALL=C to generate the output in English in the future; i.e.,

LC_ALL=C sudo pacman -Syu python-jsonschema

Well, unless you post in the #languages:portuguc3aas forum category.

Thanks, I didn’t knew about that.

And it

And that actually worked, gns3 opened, Thanks a lot!

well, that’s a computing mystery I guess

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.