Here’s the Python docs on virtual environments: https://docs.python.org/3/library/venv.html
Which also links to https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments

Starting with Python 3.13, we implement PEP 668: https://packaging.python.org/en/latest/specifications/externally-managed-environments/#externally-managed-environments This is a layer of protection which prevents common problems which can arise when pip is allowed to freely install in to the base package namespace.


* Using pip with the system package namespace can break packages delivered via yum. For instance, a package can be upgraded to a version which breaks compatibility with another system package.
* In addition, yum upgrades will indiscriminately replace any modified Python packages, so if you upgrade the package with pip and we rebuild it to patch a bug, yum will downgrade it.

As Jack said, always best to work in a virtual environment.

From: OpenSource <opensource-bounces@xxxxxxxxxxxxxxxxxx> on behalf of stefan@xxxxxxxxxx <stefan@xxxxxxxxxx>
Date: Saturday, March 22, 2025 at 1:00 PM
To: 'IBMi Open Source Roundtable' <opensource@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] Re: [IBMiOSS] Do worry - Python newbie calling
Thanks Jack, will try to read up on virtual environments.
Need to find a solution that works in a production environment.

Best regards

Stefan

--
No trees were killed in the sending of this message, but a large number of electrons were terribly upset.

Stefan Tageson
+46 732 369934
stefan@xxxxxxxxxx

-----Original Message-----
From: OpenSource <opensource-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jack Woehr via OpenSource
Sent: Saturday, March 22, 2025 6:58 PM
To: 'IBMi Open Source Roundtable' <opensource@xxxxxxxxxxxxxxxxxx>
Cc: Jack Woehr <jack.woehr@xxxxxxxxxxx>
Subject: Re: [IBMiOSS] Do worry - Python newbie calling

Always. Work. In. A. Virtual. Environment.

________________________________
From: OpenSource <opensource-bounces@xxxxxxxxxxxxxxxxxx> on behalf of stefan@xxxxxxxxxx <stefan@xxxxxxxxxx>
Sent: Saturday, March 22, 2025 11:55
To: 'IBMi Open Source Roundtable' <opensource@xxxxxxxxxxxxxxxxxx>
Subject: Re: [IBMiOSS] Do worry - Python newbie calling

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hi Craig,
When doing so I still get the same problem:
# python -m pip install xlsxwriter
error: externally-managed-environment



Jack Woehr
Independent Consulting Programmer

303-847-8442

jack.woehr@xxxxxxxxxxx

www.procern.com<http://www.procern.com>

Stay Connected!

Not Just MSP, We Also MSSP.

 NON-DISCLOSURE NOTICE: This communication including any and all attachments is for the intended recipient(s) only and may contain confidential and privileged information. If you are not the intended recipient of this communication, any disclosure, copying further distribution or use of this communication is prohibited. If you received this communication in error, please contact the sender and delete/destroy all copies of this communication immediately.
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/opensource .

--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/opensource .

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.