1

I need to use python3.10 on Ubuntu23.04.

I've tried to install python3.10 on Ubuntu23.04, alongside with python3.11. And, it looks like it has been installed.

But, python3.10-venv didn't.

Than I've tried to switch versions and try install python3.10-venv again, working under python3.10, and looks like they have been switched.

But, with python3.10 i have not-working package manager

(looks like python3.11 is used in 23.04 system components).

I've tried to sudo add-apt-repository ppa:deadsnakes/ppa, working under python3.11 (bc apt doesn't work with python3.10 in current situation), but soon i realised,

that deadsnakes doesn't support Ubuntu 23.04 for now.

So, is there any variants how to install fully working python3.10 alongside with python3.11 on Ubuntu23.04, with working package manager?

Raffa
  • 32,237
MIku
  • 91
  • @Raffa, thanks for response. But i have no problem with working under python3.11 for now. In case i switch the system wide python ver to 3.11 (even without loading live disk and rerooting system, like in this linked manual), i can absolutely normally work with apt and all stuff from ubuntu 23.04. Main problem is to use python3.10. I can use this version normally, but i can't install basic packages for it, like venv – MIku Jun 28 '23 at 10:26
  • 2
    Prior to Python3.11, the venv package was named python3-venv ... You can as well do pip3 install virtualenv then virtualenv env -p /bin/python3.10 ... Or even /bin/python3.10 -m pip install virtualenv and then /bin/python3.10 -m virtualenv env – Raffa Jun 28 '23 at 10:36
  • @Raffa, thank you very much. Your last solution was very clear and elegant, imho. And it works pretty smooth! :) Thanks again. :))) – MIku Jun 28 '23 at 10:58
  • @Raffa, sorry about disturbing, but, all worked well, except PyCharm. It can't handle python3.10 somehow. When i'm trying to select venv in interpreter settings, it doesn't select it at all. Any thoughts? :) – MIku Jul 03 '23 at 08:13
  • Do you select the python executable in that virtual environment's directory or do you select the activation script? as the latter will not work but the former should work ... See for example how to directly use a virtual environment without activating it https://askubuntu.com/a/1459030 – Raffa Jul 03 '23 at 09:54
  • @Raffa, i activate venv firstly (it actually creates). It works via operating with command line. But, Pycharm builtIn methods can't run selected copy of python. I select the necessary folder and python copy via PyCharm UI, but it doesn't apply to the project in PyCharm. – MIku Jul 03 '23 at 11:03
  • Have you tried this https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html ? – Raffa Jul 03 '23 at 14:45
  • @Raffa, of course i did :). It doesn't work neither with manual creating nor with automatic (by pycharm, like in the link) PyCharm simply drops the selecting process and even doesn't show choose 3.10 interpreter in the existing interpreters list. – MIku Jul 03 '23 at 15:06
  • I don't use PyCharm myself but I'm sure there are members of this community who do and probably can help with that ... So, maybe it's time you post that in a new question. – Raffa Jul 03 '23 at 15:12

1 Answers1

0

Using python3.11 as default and compiling python3.10 from source with adding the usr/local/bin to PATH and updating alternatives for python (with setting python3.11 as default) solved the problem for me.

MIku
  • 91