Managing multiple versions of Python in Manjaro

I was taught that installing Python versions alongside the one which came from the system can be catastrophic in Mint and that I should use pyenv. I really like pyenv + PyCharm, but in Manjaro it requires ncurses5, which comes from AUR. As a noob, I’d rather not use the AUR. I looked into virtualenv and pipenv, but it is my impression that they require that I do exactly what I’m trying to avoid, namely to install Python versions directly to my SSD.

However, Manjaro is different from Mint. Can I, for instance, just install Python 3.10 and 3.8.2 without any worries?

OTOH, ncurses5 from AUR seems to be approved by the pyenv creators themselves. If I trust pyenv, aren’t I foolish to mistrust AUR?

I think, using conda might be a good alternative.

By the way,

pacman -Si pyenv   

returns

Repository      : community
Name            : pyenv
Version         : 2.0.4-1
Description     : Easily switch between multiple versions of Python
Architecture    : any
URL             : https://github.com/pyenv/pyenv
Licenses        : MIT
Groups          : None
Provides        : None
Depends On      : bash
Optional Deps   : git: installing development versions
Conflicts With  : None
Replaces        : None
Download Size   : 199.12 KiB
Installed Size  : 2358.74 KiB
Packager        : David Runge <dvzrv@archlinux.org>
Build Date      : Tuesday 27 July 2021 02:15:47 AM
Validated By    : MD5 Sum  SHA-256 Sum  Signature

Doesn’t look like pyenv depends on ncurses5.

Pyenv doesn’t depend on ncurses5…

Oh. I was certain that I was having problems because of the lack of dependencies.

I installed pyenv via Pamac and tried to install Python 3.8.2. Build failed.

Last 10 log lines:
config.status: creating pyconfig.h
creating Modules/Setup.local
creating Makefile


If you want a release build with all stable optimizations active (PGO, etc),
please run ./configure --enable-optimizations


/usr/share/pyenv/plugins/python-build/bin/python-build: line 785: make: command not found

First I had a problem because I needed gcc. That was solved, but another problem appeared.

What problem appears now after make is base-devel is installed?

I didn’t install base-devel. The reasoning behind that is explained in the first post of this topic (but for a different package).

Whoa, I missed this:

If you’ve got something like that:

$ pyenv install 2.7.5 Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz... Installing yaml-0.1.4... BUILD FAILED

Please, be sure to have “make” installed ($ sudo apt-get install make). On Ubuntu Server, by default, it doesn’t.

I have successfully installed Python 3.8.2 into pyenv. Without AUR.

I apologize for wasting your time. I plan to give back to the Manjaro community by donating.

Nothing to apologize. Always happy to help. :slightly_smiling_face:

base-devel is in the official repos.
I just installed python-3.8.2 using pyenv. Installed just fine.

sudo pacman -S pyenv

gives -

resolving dependencies...
looking for conflicting packages...

Packages (1) pyenv-2.0.4-1

Total Download Size:   0.09 MiB
Total Installed Size:  2.30 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 pyenv-2.0.4-1-any                                   87.4 KiB  43.0 KiB/s 00:02 [#############################################] 100%
(1/1) checking keys in keyring                                                  [#############################################] 100%
(1/1) checking package integrity                                                [#############################################] 100%
(1/1) loading package files                                                     [#############################################] 100%
(1/1) checking for file conflicts                                               [#############################################] 100%
(1/1) checking available disk space                                             [#############################################] 100%
:: Processing package changes...
(1/1) installing pyenv                                                          [#############################################] 100%
Optional dependencies for pyenv
    git: installing development versions [installed]
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

Then

pyenv install 3.8.2                                                                                           ✔  6s  

gives

Downloading Python-3.8.2.tar.xz...
-> https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
Installing Python-3.8.2...
Installed Python-3.8.2 to /home/vms/.pyenv/versions/3.8.2

I believe you. I had looked up base-devel in Pamac and saw some meta stuff from AUR, as well as a bunch of packages which I had already had installed. I took this to mean base-devel is from AUR.

You could just enter

sudo pacman -S base-devel

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