What is the best way of installing Python's scientific libraries in MacPorts?

Giuseppe 'ferdy' Miceli ferdy at ferdy.it
Mon Oct 4 14:24:37 UTC 2021


	ciao artemio,

> Hi, Giuseppe,

<omissis>

> So my questions are:
> 
> 1. Should I activate python39 and decativate python37 before installing the 3.9 versions fo numpy, scipy and matplotlib?

I would daresay to remove everything (—force option would be handy) and then start over again from scratch :-)

> Can both be active at the same time after that, or should I keep 3.7 inactive for good (or unistall it)?

you can have python37 and python39 both installed and active and choose with port select which one to use as python3 default version.

wabi:macports-ports admin$ port installed python3\*
The following ports are currently installed:
  python3_select @0.0_2 (active)
  python37 @3.7.12_0+optimizations (active)
  python39 @3.9.7_0+optimizations (active)
wabi:macports-ports admin$ port select --list python3
Available versions for python3:
	none
	python37
	python38-apple
	python39 (active)
wabi:macports-ports admin$

nevertheless imho, being your first try with macports, i would suggest to choose one version and have it working with a specific version.
you will always have time to experimenting with more than one version.

> 2. Should I install (say) py-numpy or more specifically py39-numpy?

from macports perspective that is the same port (more specifically py39-numpy is a subport of py-numpy.
thus if you install py-numpy you shall end up with py39-numpy.

> 3. Is it OK if the 3.7 versions of the py-* package are active throughout this installation process (and afterwards), or should I also deactivate them?

as i mentioned before i would deactivate/uninstall the python37 versions just to be double sure.

> 4. Will "jupyter notebook” automatically find the scientific libraries I’m going to install, or should I do something else (like, e.g., create an environment)?

apologies, on this one i have to surrender since in this case it’s me not coming from math :-)

my experience with macports makes me think it should work out of the box, yet that is really above my paygrade. sorry

> Again, I apologize for my ignorance (I’m coming from Mathematica, but I would like to try python out because many of my colleagues now use it).

absolutely no need to apologize! i am sure if i were coming with silly questions on math you would do your best to help me out ;-)

cheers,
—
ferdy

> Artemio
> 
> 
> Artemio Gonzalez Lopez
> artemiog at mac.com <mailto:artemiog at mac.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20211004/aea5c83f/attachment.htm>


More information about the macports-users mailing list