installing python 3.6 on leap

What’s the recommended way to install python 3.6+ on Leap?

Upgrading to Leap 15… :wink:

The latest python is available in the [noparse]devel:lang:python:Factory[/noparse] repo for Leap 42.3 as well though:
https://download.opensuse.org/repositories/devel:/languages:/python:/Factory/openSUSE_Leap_42.3/

Updated python modules are available in [noparse]devel:lang:python:[/noparse]
https://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_Leap_42.3/

I cannot tell you whether replacing the system’s python3 would be a good idea or might rather cause problems though.

Thanks.

What is Leap 15, compared with Leap 42.3?
I don’t understand the difference in numbering.

Leap 15 is the next major version, 15.0 is the successor of Leap 42.3.
It’s still beta, the release is currently targeted for May.

The reason for the versioning:
Leap 42 is based on SLE12, and it was desirable to somehow reflect that in the version number.
But the previous openSUSE version was 13.2 already, after some discussions 42 was chosen (as a reference to The Hitchhiker’s Guide To The Galaxy), 42 = 12 + 30.
Originally, the next version was supposed to be 43(.0).
But then SUSE decided to skip versions 13 and 14 for SLE and use 15 as version number for the next release, so the version numbers could finally be “merged” again. I.e. Leap 15 is based on SLE 15.

On Thu, 01 Feb 2018 21:56:01 +0000, wolfi323 wrote:

> But the previous openSUSE version was 13.2 already, after some
> discussions 42 was chosen (as a reference to ‘The Hitchhiker’s Guide To
> The Galaxy’
> (https://en.wikipedia.org/wiki/The_Hitchhiker’s_Guide_to_the_Galaxy)),
> 42 = 12 + 30.

There also is a history of “42” in the openSUSE project; the initial
version of YaST and the original SuSE Linux distro both were tied to that
version number (as I recall, 0.42 and 4.2, respectively).

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Thanks Gs. :cool:

Use the openSUSE repos if you want to upgrade python on your system.

If you instead want or need to install python version side by side, you can do this using virtualenv… Although you can install virtualenv also from the openSUSE repos, it’s probably better to use pip to install from the official Python repos.

The virtualenv documentation

https://virtualenv.pypa.io/en/stable/

Or, use virtualization, you can install or upgrade python in isolated machines, changes and configurations in each machine won’t affect what is on your main system or other virtual machines.

HTH,
TSU

Thanks.

I found https://gist.github.com/antivanov/01ed4eac2d7486a170be598b5a0a4ac7
but have not tried that yet.

Pyenv looks like a very nice way to complement and manage your virtualenv.
Curious and a bit amusing that pyenv is a derivative of rbenv(which I strongly endorse over the more popular rvm for similar Ruby version management) which in turn was derived from virtualenv. Derivatives coming full circle.

In any case, it looks like the script you intend to run implements pyenv’s “manual installation” described in pyenv’s official documentation,

The only slight drawback with the architecture of pyenv (and rbenv) is that there will be a number of situations you’ll need to re-hash your shims… eg updating pyenv and each time you install/uninstall a python version.

Good Luck,
TSU

I added the repository
https://download.opensuse.org/repositories/devel:/languages:/python:/Factory/openSUSE_Leap_42.3/

zypper install python3-3.6.4-210.1.x86_64

It uninstalled various of packages, such as python3-apparmor.

Things seem to work.

Unfortunately, it doesn’t seem to offer https://pypi.python.org/pypi/pip
I’d like to use it to get https://pypi.python.org/pypi/PyQt5/5.10

I did find https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py
but have not tried it yet.

https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py

python3 get-pip.py --user

export PATH=$PATH:~/.local/bin

pip install --user sip pyqt5

I tested that it worked with:

cd src
git clone --depth 1 https://github.com/leo-editor/leo-editor.git
python3 ~/src/leo-editor/launchLeo.py

:cool:

Yes, because they have to be built against the same python version.

Even if they wouldn’t have been uninstalled, they wouldn’t work anymore because the files are installed to /usr/lib/python3.4/…
That’s what I hinted at in my previous post.

Unfortunately, it doesn’t seem to offer pip · PyPI
I’d like to use it to get PyQt5 · PyPI

Well, pip is a tool to manually install modules from the Internet, so it probably doesn’t make much sense to offer it as openSUSE package.
You don’t need it as long as you stick to openSUSE packages.

PyQt5 is available as openSUSE package btw, it’s called python-qt5 and the latest one is in KDE:Qt5 (it probably should match your installed Qt5 version anyway).
But also in this case, the 42.3 packages would only work with python 3.4 as shipped in 42.3.

It’s worth noting that we don’t need Qt installed when we install PyQt with pip.

Sure, but it probably doesn’t make much sense…

PyQt5 are the Qt5 python bindings, i.e. it makes it possible to use Qt5 functions/classes from Python scripts.
If Qt5 is not installed, such scripts won’t even start I suppose.

I wasn’t clear with post #11.
I was trying to say it all works perfectly now.

“The wheels include a copy of the required parts of the LGPL version of Qt.”

-> https://pypi.python.org/pypi/PyQt5

Actually one thing that isn’t perfect is the xfce startup.
After I switched python versions, it hangs on the loading screen;
however, if I ctrl+alt+f1 then ctrl+alt+f7
I come back to a perfectly loaded desktop.
Does xfce use python at startup?

journalctl doesn’t have any xfce entries.

Nevermind, I think that was related to:
nvidia-settings -> x server display configuration -> advanced -> force composition pipeline

Removing it from /etc/X11/xorg.conf allowed for it to load without the tty switching.

You should have followed the documentation/instructions for get-pip.py.
If you had, you would not have to do anything special and would have not run this get-pip.py

On your referenced page
https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py

There is a section “Using Linux Package Managers” with a link to the following page
https://packaging.python.org/guides/installing-using-linux-tools/#installing-pip-setuptools-wheel-with-linux-package-managers

And,
On that page it describes our zypper commands for installing the required pip and python setup tools packages, plus python wheel (the last I’ve never used).
This is the proper way to set up when you use Python from the distro repository (which is what you are doing).

Frankly, I have a hard time imagining any scenario where this “get-pip.py” might be used.
Even if you install python from the official Pypi repos, you can always update pip and install these packages from that non-distro repo the usual ways without a special package like get-pip.py which appears to be a self-contained blob containing these Base64 encoded binaries.

TSU

As wolfi already said “But also in this case, the 42.3 packages would only work with python 3.4 as shipped in 42.3.”

Not having tried to install Factory python on a 42.3,
I can’t verify what exactly happens to your system but I generally assume that installing a Python version should make changes that either entirely replaces the previously installed Python or configures a mish-mash of old and new that overall supports the new version.

In any case the number of python 3.6 packages in the Factory repo is remarkably low, so I highly doubt it’s intended to be a complete python repo, my guess is it’s more likely intended to supplement Tumbleweed. At most, it might only provide python base support and nothing more. There is a tools package which would be required but no pip or wheel packages for which older packages are likely no problem.

TSU