Cookie Consent by Free Privacy Policy Generator ๐Ÿ“Œ Pip install and Python's externally managed

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š Pip install and Python's externally managed


๐Ÿ’ก Newskategorie: Tools
๐Ÿ”— Quelle: kali.org

TL;DR: pip install is on the way out. Installing Python packages must be done via APT, aka. Kali Linuxโ€™s package manager. Python packages coming from other sources should be installed in virtual environments.

Long story below.

Some background

Back in February this year, for a few days, some of you might have tried (and failed) to install Python packages with Pip, aka. Pythonโ€™s package manager. Suddenly it didnโ€™t work anymore, and it gave this error message instead:

โ”Œโ”€โ”€(rootใ‰ฟkali)-[~]
โ””โ”€$ pip install xyz
error: externally-managed-environment
? This environment is externally managed
โ•ฐโ”€> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.11/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation
or OS distribution provider. You can override this, at the risk of breaking
your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

This change came about without a notice, and judging by the early reports that we received, it was clear that it would impact many users. So we reverted it, and therefore pip install still works in Kali Linux these days. But not for long: when Python 3.12 hits Kali (around end of 2023 or beginning of 2024), it will stop working, this time for good. Thereโ€™s not much we can do about it, itโ€™s an upstream change, we have to go with the flow.

So why this change? Running pip install as root, in order to install Python packages system-wide, has never been a great idea. In a Linux distribution such as Kali, Python packages are already installed and managed via APT. If you bring in another package manager (pip in this case), it is likely to break packages and programs that were installed by APT, sooner or later. Then APT might break again what was installed by pip. Both package managers will endlessly step on each otherโ€™s toes.

One could also run pip install --user to install packages in the userโ€™s home directory, but the problem is the same. Those packages will be picked up by Python applications as they run, and might not be compatible with other packages installed by APT, causing programs to misbehave or break.

The issue is not new, but it doesnโ€™t impact all users equally. Seasoned users of Linux distributions already know what to do, and NOT to do, and they can fix their system when it breaks. However, unexperienced users donโ€™t know, so they are likely to shoot themselves in the foot. And nobody can blame them, there are so many web pages out there recommending to run sudo pip install without providing enough context.

We (Kali developers, and more generally distro developers), are well aware of the issue: bug reports for Python applications that donโ€™t work are a common occurence, and we often canโ€™t reproduce the issue, and we often find out that it doesnโ€™t work because some packages or applications were installed with pip, and interfere with other packages installed with APT. These recurring bug reports are not actionable, thereโ€™s nothing we can fix on our side. Users get burnt and they learn from it, but itโ€™s no fun.

Whatโ€™s changing

Now, back to the upcoming change: in Kali Linux, starting with Python 3.12, pip will refuse to perform system-wide installs (sudo pip install) as well as user home directory installs (pip install --user). This is good news, because it will make it harder for unexperienced users to break their system. This is a welcome change, and we are thankful to those who drove this change and made it happen. Long-term, it will be less pain for everyone. But short-term, some users wonโ€™t like it, of course, we know.

So if youโ€™re one of those who run sudo pip install, who have it hardwired in your fingersโ€ฆ well, youโ€™ll have to adjust. You might want to have a look at pipx, get more familiar with Pythonโ€™s virtual environments, and spend some time reading PEP 668: Marking Python environments as externally managed to better understand the issue at hand.

To finish, and to give a bit of a broader context: the PEP 668 proposal came about as a coordinated effort from various software distributions to fix this long-standing issue of pip breaking other package managers too easily. The change is already effective in other Linux distros (like the latest release of Debian). In Kali Linux, we just delayed it a bit, so that we can warn you in advance, so that you can adjust your workflow and scripts. But the change is coming with Python 3.12, thereโ€™s no point delaying it further.

Thanks for reading!

...



๐Ÿ“Œ Pip install and Python's externally managed


๐Ÿ“ˆ 70.43 Punkte

๐Ÿ“Œ Pip Install Specific Versionโ€Šโ€”โ€ŠHow to Install a Specific Python Package Version with Pip


๐Ÿ“ˆ 55.93 Punkte

๐Ÿ“Œ Handling Externally Managed Environment Error With Pip in Ubuntu 23.10


๐Ÿ“ˆ 55.66 Punkte

๐Ÿ“Œ Pip Upgrade โ€“ And How to Update Pip and Python


๐Ÿ“ˆ 46.37 Punkte

๐Ÿ“Œ In-house Versus Externally Managed Security Services


๐Ÿ“ˆ 37.47 Punkte

๐Ÿ“Œ How to Fix โ€œerror: externally-managed-environmentโ€ on Raspberry Pi Bookworm


๐Ÿ“ˆ 37.47 Punkte

๐Ÿ“Œ How To Install and Manage Python Packages on Linux With PIP [Tutorial]


๐Ÿ“ˆ 32.96 Punkte

๐Ÿ“Œ How To Install and Manage Python Packages on Linux With PIP [Tutorial]


๐Ÿ“ˆ 32.96 Punkte

๐Ÿ“Œ How to Install / Update Python & PIP in Kali Linux 2020.4 (Ubuntu, MX Linux, Debian, Linux Mint)


๐Ÿ“ˆ 31.19 Punkte

๐Ÿ“Œ รœberschreiben von Dateien in python-pip und python-scripttest (SUSE)


๐Ÿ“ˆ 31.08 Punkte

๐Ÿ“Œ Leaking Windows Creds Externally Via MS Office - Tradecraft Security Weekly #21


๐Ÿ“ˆ 27.58 Punkte

๐Ÿ“Œ Did you know that multimedia speed is externally controllable ?


๐Ÿ“ˆ 27.58 Punkte

๐Ÿ“Œ openSUSE Open Build Service HTTP Request externally controlled reference


๐Ÿ“ˆ 27.58 Punkte

๐Ÿ“Œ U.S. Dept Of Defense: HAProxy stats panel exposed externally


๐Ÿ“ˆ 27.58 Punkte

๐Ÿ“Œ CVE-2019-18269 | Omron PLC CJ/PLC CS Lock unrestricted externally accessible lock


๐Ÿ“ˆ 27.58 Punkte

๐Ÿ“Œ CVE-2019-11485 | Apport Lock File unrestricted externally accessible lock (usn-4171-1)


๐Ÿ“ˆ 27.58 Punkte

๐Ÿ“Œ How to get Python and Pip working on Windows


๐Ÿ“ˆ 26.41 Punkte

๐Ÿ“Œ TIL that Python's pip is not curated, and anybody can publish code (malicious or otherwise).


๐Ÿ“ˆ 26.41 Punkte

๐Ÿ“Œ [$] Python, packaging, and pipโ€”again


๐Ÿ“ˆ 26.41 Punkte

๐Ÿ“Œ Meet UniDep: A Tool that Streamlines Python Project Dependency Management by Unifying Conda and Pip Packages in a Single System


๐Ÿ“ˆ 26.41 Punkte

๐Ÿ“Œ How to fix โ€˜setup.py โ€“no-user-cfg installโ€™ error for pip on macOS


๐Ÿ“ˆ 24.74 Punkte

๐Ÿ“Œ How to fix โ€˜setup.py โ€“no-user-cfg installโ€™ error for pip on macOS


๐Ÿ“ˆ 24.74 Punkte

๐Ÿ“Œ Next Debian/Ubuntu Releases Will Likely No Longer Allow pip install Ouside A Virtual Environment


๐Ÿ“ˆ 24.74 Punkte

๐Ÿ“Œ 3 Ways to Solve Pip Install Error on Ubuntu 23.04


๐Ÿ“ˆ 24.74 Punkte

๐Ÿ“Œ How to Install pip on Ubuntu 24.04


๐Ÿ“ˆ 24.74 Punkte

๐Ÿ“Œ Linux pip install problems


๐Ÿ“ˆ 24.74 Punkte

๐Ÿ“Œ Mehrere Probleme in python-pip (Red Hat)


๐Ÿ“ˆ 24.64 Punkte

๐Ÿ“Œ Mehrere Probleme in python-pip (CentOS)


๐Ÿ“ˆ 24.64 Punkte

๐Ÿ“Œ Mehrere Probleme in python-pip (Red Hat)


๐Ÿ“ˆ 24.64 Punkte

๐Ÿ“Œ Mehrere Probleme in python-pip (Red Hat)


๐Ÿ“ˆ 24.64 Punkte

๐Ÿ“Œ รœberschreiben von Dateien in python-pip (SUSE)


๐Ÿ“ˆ 24.64 Punkte

๐Ÿ“Œ รœberschreiben von Dateien in python-pip (SUSE)


๐Ÿ“ˆ 24.64 Punkte

๐Ÿ“Œ รœberschreiben von Dateien in python-pip (SUSE)


๐Ÿ“ˆ 24.64 Punkte











matomo