Python 3.8.2 - Macports configuration problem

Christopher Jones jonesc at hep.phy.cam.ac.uk
Fri May 1 08:28:16 UTC 2020



> On 1 May 2020, at 9:17 am, Dr M J Carter <Martin.Carter at physics.ox.ac.uk> wrote:
> 
> On Thu, Apr 30, 2020 at 11:13:45PM +0200, Max Anglad wrote:
> 
>> Note that pip (python package installer) must apparently be used via
>> sudo if you want the packages to be installed in the right place
>> (/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages)
> 
> That'll break Python and/or MacPorts: consider if one of the Python
> packages in MacPorts gets updated, or if you happen to later install a
> MacPorts port which pulls in a Python package which conflicts with one
> you've hand-installed.  There's better ways to layer your own packages
> on top of a Python installation without using sudo, of which setting
> up a virtual Python under your home directory is the newest and most
> highly recommended.  A web search for "virtual python" should be most
> fruitful.

I completely second the above. Do not use pip to install into the MacPorts prefix, you will run into a lot of problems doing this.

In addition to the virtual env. approach, also note macports has its own ports for most of the commonly used python packages. Just run

> port search py38-

to list them. Its quite probable that all you need is available in macports already.

Chris

> 
> Apologies if I come across as strident: I've seen the same mistakes
> being made by postgrads for entirely too long, and this bear trap in
> particular seems to claim more of them than most.  Good luck in your
> Python endeavours.
> 
> -- 
> Dr Martin J Carter
> Computer System Administrator (WFH)
> Astrophysics, University of Oxford

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1930 bytes
Desc: not available
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20200501/3bd9f295/attachment.bin>


More information about the macports-users mailing list