Python 3.8.2 - Macports configuration problem

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



> On 1 May 2020, at 12:52 pm, Max Anglad <max.anglad at gmail.com> wrote:
> 
>> 
>> On 1 May 2020 at 10:28, Christopher Jones <jonesc at hep.phy.cam.ac.uk> wrote :
>> 
>>> 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.  
> 
> Ok, I understand,  and I didn't realize that most of the Python packages had also been "Macported".
> 
> (Note that I only use standard Python packages like matplotlib, scipy, pandas, jupyter,...)
> 
> But I see that there is however a port of the pip installer : https://ports.macports.org/port/py38-pip/summary <https://ports.macports.org/port/py38-pip/summary>
> 
> Do you also advise against using it ? Does it not install Macported Python packages in the right place ?

As an end user you should not use pip, any version of it, to install packages directly into the MacPorts prefix. period.

As previously noted, you can though use it for instance inside a virtual env. that is just fine.

( Also, the macports pip package is also there to help certain macports ports internally on how they build themselves, and install into the macports prefix. )

Chris

> 
> I find that documentation is missing on the correct way to use Python and its packages via Macports, or I did not find it
> 
> 
>> 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
> 
> Ok, but these Macported packages I install them with py38-pip (python3 -m pip install <python-pkg>) 
> or conventionally with : sudo port install <python-pkg> ?
> 
> 
>>> 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.
> 
> In software development I have a long experience in C/C++ and shells under Unix, but I am still a beginner in Python and its mechanisms
> 
> Thank you all for your valuable advice.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20200501/35a7bc51/attachment.html>
-------------- 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/35a7bc51/attachment.bin>


More information about the macports-users mailing list