You are not logged in.

#1 2021-02-22 11:26:19

DocCyco
Member
Registered: 2021-02-22
Posts: 5

[Solved] Python 3.9 pkg_resources not found

Hi,

Since the switch from python 3.8 to python 3.9, I have problems with some applications like ipython for example which doesn't launch because it doesn't find the pkg_resources module.

This one is well installed :

pacman -Q python-setuptools
python-setuptools 1:53.0.0-1

I am currently using Python 3.9.1.

pacman -Qkk 1>/dev/null

returns nothing about python.  I reinstalled all python 3.9 packages :

pacman -S $(pacman -Qqo /usr/lib/python3.9/)

No more ideas. How can I solve this ?

Last edited by DocCyco (2021-02-22 13:49:00)

Offline

#2 2021-02-22 11:45:36

loqs
Member
Registered: 2014-03-06
Posts: 19,022

Re: [Solved] Python 3.9 pkg_resources not found

Please launch ipython from the console and post the full output from it failing https://bbs.archlinux.org/viewtopic.php?id=57855

Offline

#3 2021-02-22 12:33:41

DocCyco
Member
Registered: 2021-02-22
Posts: 5

Re: [Solved] Python 3.9 pkg_resources not found

>>> ipython
Traceback (most recent call last):
  File "/home/user_id/.local/bin/ipython", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'

Offline

#4 2021-02-22 12:36:58

loqs
Member
Registered: 2014-03-06
Posts: 19,022

Re: [Solved] Python 3.9 pkg_resources not found

You are not using ipython 7.19.0-5?  Are all the issues related to pip installed packages?

Offline

#5 2021-02-22 12:51:17

DocCyco
Member
Registered: 2021-02-22
Posts: 5

Re: [Solved] Python 3.9 pkg_resources not found

I installed ipython from arch repositories.
I always try to install the general purpose modules directly on the system using pacman. For particular configurations I work in a virtual environment and I only use pip if a module is not available in arch repo.

>>> pacman -Q ipython                                                                                                                                    
ipython 7.19.0-5
>>> pip show ipython                                                                                                                                            
Name: ipython
Version: 7.19.0
Summary: IPython: Productive Interactive Computing
Home-page: https://ipython.org
Author: The IPython Development Team
Author-email: ipython-dev@python.org
License: BSD
Location: /usr/lib/python3.9/site-packages

EDIT: jupyter-console works correctly, but the command jupyter notebook list returns the same error.

Last edited by DocCyco (2021-02-22 12:58:23)

Offline

#6 2021-02-22 12:58:08

loqs
Member
Registered: 2014-03-06
Posts: 19,022

Re: [Solved] Python 3.9 pkg_resources not found

What is the output of the following:

type -a python
type -a ipython

Offline

#7 2021-02-22 13:01:27

DocCyco
Member
Registered: 2021-02-22
Posts: 5

Re: [Solved] Python 3.9 pkg_resources not found

>>>type -a python                                                                                                                                                
python is /usr/bin/python
python is /bin/python
type -a ipython                                                                                                                                             
ipython is /home/user_id/.local/bin/ipython
ipython is /usr/bin/ipython
ipython is /bin/ipython

The problem may come from the ipython bin in my home directory ?

EDIT:

>>>pip uninstall ipython                                                       
Found existing installation: ipython 7.19.0
ERROR: Cannot uninstall 'ipython'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Last edited by DocCyco (2021-02-22 13:04:29)

Offline

#8 2021-02-22 13:03:33

loqs
Member
Registered: 2014-03-06
Posts: 19,022

Re: [Solved] Python 3.9 pkg_resources not found

You can try the version supplied by ipython package by calling it using the full path:

/usr/bin/ipython

Offline

#9 2021-02-22 13:07:02

DocCyco
Member
Registered: 2021-02-22
Posts: 5

Re: [Solved] Python 3.9 pkg_resources not found

It works using

/usr/bin/ipython

So I probably installed ipython also with pip!
How to uninstall it properly?

EDIT: I have just realized that the bin ipython present in my home was created a long time ago in a virtual environment that I was no longer using. I have removed all the bin related to this environment and everything works fine.

The annoying thing is that if I delete a virtual environment, the bin associated with that environment are not deleted.

Last edited by DocCyco (2021-02-22 13:50:23)

Offline

Board footer

Powered by FluxBB