Python 3.8 from Factory repository for Leap 15.2 cannot create vitualenv via venv module. It is caused by very last change from Oct 30. This particular change is not yet in Tumbleweed repository:
%changelog
* Fri Oct 30 2020 Matej Cepl <mcepl@suse.com>
- Replace ensurepip with simple script instructing to install
packaged pip (bsc#1176262).
How to replicate:
# zypper addrepo https://download.opensuse.org/repositories/devel:/languages:/python:/Factory/openSUSE_Leap_15.2/ python
# zypper install python38
> python3.8 --version
Python 3.8.5
> rpm -q python38
python38-3.8.5-lp152.19.1.x86_64
> python3.8 -m venv test
Error: Command ''/home/michal/Downloads/test/bin/python3.8', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 255.
> /home/michal/Downloads/test/bin/python3.8 -Im ensurepip --upgrade --default-pip
Install the package python3-pip and run pip directly.
> cat /usr/lib64/python3.8/ensurepip.py
#!/usr/bin/python3
import sys
print("Install the package python3-pip and run pip directly.",
file=sys.stderr)
sys.exit(255)
I should note that python39 from Factory repository works fine. For python38: Is it bug or is it supposed behaviour? It looks to me like badly tested change.
I should note that python39 from Factory repository works fine. For python38: Is it bug or is it supposed behaviour? It looks to me like badly tested change.
I would ask in the OBS on the development side for python38.
Hi,
Although I have no real objection to Python virtual environment questions being asked in this Virtualization forum,
It’s unusual.
Despite the “virtual” in the technology name and description, there is actually only isolation and management not involving any virtualization and of course is specific only to the python environment and nothing else.
But, since we also discuss Linux container technologies like docker and LXC here, we do discuss non-virtualization technologies which have features similar to, and used like virtual machines.
Bottom line is that you’ll get a better audience for python environment questions in either the Applications or the Development - Scripting forums.
As for your specific problem…
Looks to me you’ve encountered a bug throwing your error, so should be submitted to https://bugzilla.opensuse.org.
But, note that you should not do what the bug is telling you to do…
Normally you would use pip but when you use Python from the openSUSE repositories, you shouldn’t… because you’d be installing components from PyPi.
When you’re using Python from the openSUSE repositories, of course you should be using zypper only, and your error shouldn’t even be thrown if all components you need are provided you.
I’ve already managed to contact the author of the change directly. According to him it was submitted to Factory by mistake and he updated the already existing bug at https://bugzilla.suse.com/show_bug.cgi?id=1176262
And yes, I also struggled to put it here or to the Application forum. Neither seems perfect. Development forum is probably the best but sadly I didn’t spotted it since I am pretty new here.
Don’t worry too much if you’ve done your best for proper placement,
If the post obviously should be moved, the Forum Admins can do that for you.
Main thing is for people to feel free to post and you did a good job investigating your problem as much as possible first so people had something to work with looking at your post.
Given the comments here I’m not sure if I should post this follow-up, but since Google led me (and, separately, some other members of my team) here, I just wanted to make clear that the bug mentioned in the thread above (1176262) is marked as resolved(-ish), and some patches are released, but they did not solve the problem reported here.
There is, however, a different bug report, here: https://bugzilla.opensuse.org/show_bug.cgi?id=1179756 which not only targets this particular problem, but also provides an immediate workaround which, for us at least, solved the problem.
Apologies again if I should not have posted, but in the interest of getting correct solutions documented, I thought I’d take the risk…