<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 4, 2021, at 12:26 PM, Giuseppe 'ferdy' Miceli <<a href="mailto:ferdy@ferdy.it" class="">ferdy@ferdy.it</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>ciao artemio,<div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 3 Oct 2021, at 23:05, Artemio González López via macports-users <<a href="mailto:macports-users@lists.macports.org" class="">macports-users@lists.macports.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">I have installed the python37 port, and would like to install the scientific libraries numpy, scipy, and matplotlib, and also jupyter. I installed by hand the ports</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">first of all, unless you have specific reasons, i would suggest to install python39. </div><div class=""><br class=""></div><div class="">depending on your choice, i would suggest to set the relevant variant in /opt/local/etc/macports/variants.conf</div><div class=""><br class=""></div><div class="">i have installed python39 and these are the variants i set up:</div><div class=""><br class=""></div></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><div class=""><div class="">wabi:macports-ports admin$ egrep python /opt/local/etc/macports/variants.conf</div></div></div></div><div class=""><div class=""><div class=""><div class="">+python</div></div></div></div><div class=""><div class=""><div class=""><div class="">-python2</div></div></div></div><div class=""><div class=""><div class=""><div class="">-python27</div></div></div></div><div class=""><div class=""><div class=""><div class="">+python3</div></div></div></div><div class=""><div class=""><div class=""><div class="">+python39</div></div></div></div><div class=""><div class=""><div class=""><div class="">wabi:macports-ports admin$</div></div></div></div></blockquote><div class=""><div class=""><div class=""><br class=""></div><div class="">secondly, installing a python3x port should have installed also python_select and python3_select ports.</div><div class=""><br class=""></div><div class="">these are intended to let you choose which version of python you would use as default (please keep in mind macports allows you to have different versions of python alongside including the apple stock ones).</div><div class=""><br class=""></div><div class="">port select —summary shall show you the correct status:</div><div class=""><br class=""></div></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><div class="">wabi:macports-ports admin$ port select --summary</div></div></div><div class=""><div class=""><div class="">Name Selected Options</div></div></div><div class=""><div class=""><div class="">==== ======== =======</div></div></div><div class=""><div class=""><div class="">docutils py39-docutils py39-docutils none</div></div></div><div class=""><div class=""><div class="">pip pip39 pip3-apple pip39 none</div></div></div><div class=""><div class=""><div class="">pip2 none none</div></div></div><div class=""><div class=""><div class="">pip3 pip39 pip3-apple pip39 none</div></div></div><div class=""><div class=""><div class="">pygments py39-pygments py39-pygments none</div></div></div><div class=""><div class=""><div class="">python python39 python27 python27-apple python38-apple python39 none</div></div></div><div class=""><div class=""><div class="">python2 python27 python27 python27-apple none</div></div></div><div class=""><div class=""><div class="">python3 python39 python38-apple python39 none</div></div></div><div class=""><div class=""><div class="">sphinx py39-sphinx none</div></div></div></blockquote><div class=""><div class=""><div class=""><br class=""></div>"sudo port select python[3] python39” allows to choose which one you would like to use.</div><div class=""><br class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><div class="">wabi:macports-ports admin$ sudo port select python3 python39</div></div></div><div class=""><div class=""><div class="">Selecting 'python39' for 'python3' succeeded. 'python39' is now active.</div></div></div><div class=""><div class=""><div class="">wabi:macports-ports admin$</div></div></div></blockquote><div class=""><div class=""><div class=""><br class=""></div><div class="">at this point you shall install the different modules and port command shall installed and correctly configure the needed ones.</div><div class=""><br class=""></div><div class="">hope it helps, please do not hesitate to ask further should you need.</div><div class=""><br class=""></div><div class="">regards,</div><div class="">—</div><div class="">ferdy</div><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">py-numpy, py-scipy, py-matplotlib, py-jupyter</div><div class=""><br class=""></div><div class="">(without specifying a version), and port installed python39, py39-jupyter and the 3.7 versions of all of the above packages. However, when I launched jupyter notebook and tried to run one of my notebooks it couldn’t find any of the scientific libraries I had installed. I then deactivated python39 and py39-jupyter, and installed py37-jupyter. It gave me numerous errors complaining that I had to activate by hand several ports (liek, e.g., sudo port -f activate py37-ipython), but in the end was built. However, when I now launch jupyter notebook I get a message complaining that no kernels where found, and when I run my notebook the scientific libraries aren’t found. I would greatly appreciate any help as to how to fix the mess I probably created, so that I could use python's scientific libraries with python’s MacPorts (instead of using, say, miniconda).</div><div class=""><br class=""></div><div class="">Sorry for my clumsiness, and thank you all in advance!</div>
<div class=""><br class=""></div>Artemio<div class=""><br class=""></div><div class=""><br class=""><div class="">
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Artemio Gonzalez Lopez<br class=""><a href="mailto:artemiog@mac.com" class="">artemiog@mac.com</a></div>
</div>
<br class=""></div></div></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""><div class="">Hi, Giuseppe,</div><div class=""><br class=""></div><div class="">Thanks a lot for your most informative reply. I’ll definitely switch to python39, as you suggested. But I am not sure how exactly to proceed, since I suspect that my botched installation of numpy, scipy, matplotlibs and jupyter may have broken something. Right now “port select —list” outputs the following:</div><div class=""><br class=""></div><div class="">Name Selected Options<br class="">==== ======== =======<br class="">cython cython37 cython37 cython39 none<br class="">gcc none mp-gcc11 none<br class="">ipython none py37-ipython py39-ipython none<br class="">ipython3 none py37-ipython py39-ipython none<br class="">llvm none mp-llvm-10 mp-llvm-9.0 none<br class="">mypy none mypy37 none<br class="">pip pip37 pip37 none<br class="">pip2 none none<br class="">pip3 none pip37 none<br class="">pygments none py37-pygments py39-pygments none<br class="">python python37 python27-apple python37 none<br class="">python3 python37 python37 none<br class="">wxWidgets none wxWidgets-3.0 none</div><div class=""><br class=""></div><div class="">I have installed both python3.7 and python3.9, although the latter is inactive:</div><div class=""><br class=""></div><div class="">artemio@imac ~ % port installed python\* <br class="">The following ports are currently installed:<br class=""> python-mode.el @1.0_0 (active)<br class=""> python3_select @0.0_2 (active)<br class=""> python37 @3.7.12_0 (active)<br class=""> python39 @3.9.7_0<br class=""> python_select @0.3_9 (active)</div><div class=""><br class=""></div><div class="">I have also 83 py37-* packages installed and active, vs 67 py39-* ones, also active (probably because the scientific libraries are only installed in their 3.7 variants), including both py37-jupyter and py39-jupyter:</div><div class=""><br class=""></div>artemio@imac ~ % port installed py\*-jupyter<br class="">The following ports are currently installed:<br class=""> py-jupyter @1.0.0_1<br class=""> py37-jupyter @1.0.0_1 (active)<br class=""><div class=""> py39-jupyter @1.0.0_1 </div><div class=""><br class=""></div><div class="">So my questions are:</div><div class=""><br class=""></div><div class="">1. Should I activate python39 and decativate python37 before installing the 3.9 versions fo numpy, scipy and matplotlib? Can both be active at the same time after that, or should I keep 3.7 inactive for good (or unistall it)?</div><div class=""><br class=""></div><div class="">2. Should I install (say) py-numpy or more specifically py39-numpy?</div><div class=""><br class=""></div><div class="">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?</div><div class=""><br class=""></div><div class="">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)?</div><div class=""><br class=""></div><div class="">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).</div><div class=""><br class=""></div><div class="">Artemio</div><br class=""><br class=""><div class="">
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">Artemio Gonzalez Lopez<br class=""><a href="mailto:artemiog@mac.com" class="">artemiog@mac.com</a></div>
</div>
<br class=""></body></html>