Hanuman
Hanuman

Reputation: 1

Python multiple version error - no module named 'No module named 'importlib._abc''

Because of some certain projects I need to run python 3.9 (32-bit) as my main python interpreter. But now I realised some problems when i try to use python 3.13 (64-bit). After installation of both versions pip from python 3.13 does not work anymore and i get following error:

Could not import runpy module
Traceback (most recent call last):
  File "<frozen runpy>", line 15, in <module>
  File "<frozen importlib.util>", line 2, in <module>
ModuleNotFoundError: No module named 'importlib._abc'

and as soon as I uninstall just the python 3.9-32 version it works all of the sudden... I also tried to reinstall python 3.9-32 but as soon as both versions are installed the pip wont work with python 3.13... Thank you for your help!

Upvotes: 0

Views: 53

Answers (1)

globglogabgalab
globglogabgalab

Reputation: 455

When dealing with different Python versions on the same system, it is VERY strongly advised to use virtual envs to avoid exactly this scenario.

python3.13 -m venv /path/to/your/venv3_13
python3.9 -m venv /path/to/your/venv3_9

# activate a venv with:
source /path/to/your/venv3_9/bin/activate
# deactivate the current venv with:
deactivate

The source line can be put in the ~/.bashrc file for instance, to activate your venv everytime you launch your bash terminal.

If you don't use venvs, pip might sometimes be pip3.9 and sometimes pip3.13, causing the issue.

Upvotes: 0

Related Questions