Friday, April 10, 2026

 Updating Anaconda After a Year of Use

First, I forgot that my blogger account was associated with my older Google account linked ti jeffreypark00@gmail.com.  I had to log out of the other account to post this info.

On 4/9/2026 I upgraded my Anaconda on my M4 Macbook Pro from 2.6.6 to 2.7.0, while running MacOS Sequoia.  Here in the relocated Items folder, I kept copies of the /opt/anaconda3 directory and an alias of the Anaconda-Navigator App.  One curious thing is that my 2.6.6 version of Anaconda Navigator in my Applications Folder was dated Feb 2025, but the same App in the old anaconda3 directory was August 2025.  This discrepancy did not prevent me from running Anaconda Navigator nor prevent me from updating it via the GUI interface. 

In contrast, on my M3 iMac in my Yale office, running MacOS Sonoma, not Sequoia, the GUI-update failed, and I recall that the Anaconda-Navigator icon in the Applications folder was an alias of the App in the /opt/anaconda3 directory.  I tried to update the Anaconda Navigator on the iMac M3 with command-line use of "conda", but the updated package failed to complete its start.  So the iMac M3 still has Anaconda-Navigator version 2.6.6.

Subsequently, I discovered that the Intel iMac at home was running Anaconda-Navigator version 2.6.5.  Here was a different problem, because the Anaconda installation appeared to be split across "/opt/anaconda3" and "/Users/jjpark/opt/anaconda3" directories, with another directory alias at /Users/jjpark/anaconda that pointed to /opt/anaconda3.  I tried to upgrade the Navigator to 2.7.0, but was rebuffed by the Anaconda website that informs me that Anaconda installers and software packages for the Intel-chip Macs are no longer getting updated.  Apple is sunsetting the architecture in its forthcoming MacOS-27 releases, so that I will eventually need to upgrade to Apple Silicon to stay with a supported MacOS.  A couple of years, maybe, before I will need to buy an M5 or M6 iMac for home.  The setup files for terminals on my Intel iMac had not all pointed to the same anaconda file, and I verified that upgrading the Navigator to 2.6.6 and refreshing the environments wrote information to both Anaconda locations.  I tried to alter the alias files to force them to a single copy of Navigator, but succeeded in disabling the software.  I returned to the last Time Machine backup, restored the altered files, copied the anaconda envs directories from /opt/anaconda3 to /Users/jjpark/opt/anaconda3 and restored the functionality of Navigator.  I also verified that software and binary updates under Navigator make changes in only one of the locations now, in /Users/jjpark/opt/anaconda3.  This is the proper location for Intel Mac systems.  Apple Silicon systems install anaconda into /opt/anaconda3.   I checked that I could update packages in the environments and run a Jupyter notebook for several steps with ObsPy commands. 


Tuesday, May 13, 2025

Dont forget to install the image-processing commands from ImageMagick

 One of the useful Unix commands I have used is "convert" from ImageMagick.  This software survived several upgrades of MacOS, but not the transition to MacOS 15.4 Sequoia.  To re-install via MacPorts, one does this following

 sudo port selfupdate

 sudo port upgrade outdated

sudo port install imagemagick

and this places the Unix line-command "convert" into /opt/local/bin

 

Tuesday, February 4, 2025

Newer versions of MacOS (Sonoma & Sequoia) will not play well with Postscript files

macOS Sonoma does not support viewing or converting PostScript filesHowever, it can still output PostScript to printers that support it.

In particular, it is no longer possible to click on a *.ps or *.eps file and open it in the Preview app. This is very very annoyingInstall ghostscript on macOS with MacPorts.  This installs a number of executables, though not pstopdf.  After reading some programmer comments, I added the following faux pstopdf to call ps2pdf with an option to trim whitespace around an image:

alias pstopdf 'ps2pdf -EPSCrop'   # will crop whitespace around image

-> which ps2pdf

/opt/local/bin/ps2pdf

-> ls -l /opt/local/bin/ps*
-rwxr-xr-x  1 root  admin    631 Feb  4 10:47 /opt/local/bin/ps2ascii
-rwxr-xr-x  1 root  admin   1264 Feb  4 10:47 /opt/local/bin/ps2epsi
-rwxr-xr-x  1 root  admin    272 Feb  4 10:47 /opt/local/bin/ps2pdf
-rwxr-xr-x  1 root  admin    257 Feb  4 10:47 /opt/local/bin/ps2pdf12
-rwxr-xr-x  1 root  admin    257 Feb  4 10:47 /opt/local/bin/ps2pdf13
-rwxr-xr-x  1 root  admin    257 Feb  4 10:47 /opt/local/bin/ps2pdf14
-rwxr-xr-x  1 root  admin   1078 Feb  4 10:47 /opt/local/bin/ps2pdfwr
-rwxr-xr-x  1 root  admin    647 Feb  4 10:47 /opt/local/bin/ps2ps
-rwxr-xr-x  1 root  admin    669 Feb  4 10:47 /opt/local/bin/ps2ps2
-> 

Sunday, February 2, 2025

Installing MacPorts on M4 MacBook Pro, Installing nedit and GFortran and TeXworks in MacPorts in MacOS Sequoia 15.3

 Installing GFortran in MacPorts after Upgrading MacOS Ventura to MacOS Sequoia 15.3.   I took the advice of MacPorts.org and deleted all traces of MacPorts on my M4 laptop once I transferred files from my 2018-vintage Intel-based MacBook Pro.  Installing MacPorts from scratch was not difficult, but starting to install familiar software packages has some interesting quirks.  

Installing my favorite visual test editor nedit was a chore, as it usually is for such legacy software.  The installation first hung on a flawed download of the lzip software package.  I needed to Google and to otherwise comb the MacPorts support site to find a suggested fix for installing lzip.  But I found a solution from someone who had preceded me.  Once I could get past the first few seconds of the nedit install, the process took a long long long time and seemed to involve the download and compilation of several versions of Python (3.10 and 3.12).  All this was necessary for a simple convenient editor to use.  Unlike the current version on the Intel-Macs, this version of nedit seems to load very quickly.  Maybe something got fixed since I installed nedit on the M3 iMac in my office.

Installing gfortran via MacPorts is proceeding apace as I write this.  I am using the same commands I ran a week ago in my Sequoia upgrade on my Intel MacBook Pro.  There is a lot of compiling going on.  The final result seems to compile my codes well.  I have recompiled the utility codes in jlib.a, plotit.a and eislib.a.  

One last upgrade was to by LaTex equation-formatting software.  I have been very happy with TeXworks for processing manuscripts and lecture notes, but attempts to compile a version of TeXworks on my M4 laptop with either software downloaded from the TeXworks website or from MacPorts has failed.  The website suggests that, as of February 1, 2025, there is a MacOS Sequoia build for TexWorks on Intel Macs, but not for Apple Silicon.  At the same time the TeXworks page suggested that an Apple Silicon build of their software was available for MacOS Sonoma.   This triggered me to look on my M3 iMac for a working version of TeXworks, because the iMac is running MacOS Sonoma.  I had not noticed any glitches when I bought my M3 iMac last May, and indeed the app was working fine on my iMac.  I copied the TeXworks app into iCloud, transferred the copy to my MacOS Sequoia MacBook Pro, and it ran fine once I deleted the MacPorts version of the app.  There is ALSO a subdirectory of my Applications folder named "Tex" that dates from prior to the pandemic and occupies 121 Mb, including yet another version of the TeXworks app.  This legacy app seems to be software that I can delete.





New M4 MacBook Pro Software Installs -- Obspy within Anaconda

 

For switching my 2018-vintage Intel MacBook Pro to Apple Silicon, the old Anaconda installation persisted after I transferred files from the old laptop.  The location of the files was /Users/jjpark/opt/anaconda3, but there were also obsolete files in /Users/jjpark/anaconda3.  

The first thing to do is download Anaconda for Apple Silicon from www.anaconda.com site.  The New location for Anaconda files is the "shared" directory /opt/anaconda3.   When I opened Anaconda Navigator, the software asked me to update its version -- undating the Navigator is a tricky operation that fails unless you delete the correct process while leaving the updating process active.  Then you need to wait a bit before the Updator activates the button that you click to update the Navigator.  Annoying!

Once into Anaconda, it is useful to delete the old Intel-based environments, which occupy 1-4 Gbyte of disk space without being useful.  If the environment depends on Python 3.6 (/Users/jjpark/anaconda3) or depended on Python 3.9 in an Intel installation (/Users/jjpark/opt/anaconda3), one can use the Navigator to remove these environment and release the disk space.  There is a "Remove" button at the bottom of the Environments pane of Anaconda Navigator.

The new processing environments are located in /opt/anaconda3/envs.  To create these environments, I used the same commands as for the older computers.  The current Python version in Anaconda is 3.12, but I stayed conservative and kept my ObsPy environment in 3.9.  I have no assurance that ObsPy has been adapted to the latest Python versions, and 3.9 was working for me.

My solution is to create a new environment for the new obspy environment, and install Python 3.9 directly into it.  First, open a terminal window within Anaconda.  From the webpage:

https://www.geophysik.uni-muenchen.de/~megies/installation2.pdf

Create a new environment within Anaconda by typing commands into the terminal window"

conda create -n obspy python=3.9 cartopy=0.21

conda activate obspy

conda info --envs

assuming that you are in the obspy environment . . .

conda install -c conda-forge obspy

conda install -c conda-forge jupyter

conda install -c conda-forge cartopy

conda deactivate

Note that I installed cartopy, rather than basemap.  I also used the option "-c conda-forge" for all install commands.   The most recent version of cartopy crashed my SS-precursor Jupyter notebook, so I restricted cartopy to the version on my Intel laptop, cartopy 0.21.  HOWEVER my Anaconda environment tells me that the casrtopy version there is 0.23.0, so I am not certain how I fixed the problem by specifying cartopy=0.21.  I found that I also needed to update scipy in my obspy environment to enable the notebook to import all the obspy libraries.  In that case my obspy environment DOES NOT have the highest upgrade of scipy, so that is a mystery as well.  The SS-precursor notebook executes into the data requests, however.

One quirk is that the new Anaconda python version does not allow me to use numpy.shape to return the dimensions of a list of lists.  I may stumble on more errors, but this is curious, because the M3 iMac did not present me with this syntax hangnail.


Thursday, January 30, 2025

Installing GFortran in MacPorts after Upgrading MacOS Ventura to MacOS Sequoia 15.3

 Installing GFortran in MacPorts after Upgrading MacOS Ventura to MacOS Sequoia 15.3

I purchased an M4 MacBook Pro laptop to replace my 2019-vintage Intel MacBook Pro.  The older laptop was still working well, aside from running out of disk space, but the prospect of China tariffs motivated an accelerated purchase and upgrade.  The new M4 laptop has actually been waiting a month for my changeover.  I decided to upgrade the older laptop to Sequoia MacOS to facilitate the transfer of files and file structures.  This enables me to perform the dirty work of reviving my computing environments in the context of a familiar keyboard.  

When I tried to compile a Fortran code in Sequoia before upgrading the Fortran installation, the compiler failed because it looked for a directory that exists in Ventura, but does not exist in Sequoia.  So I definitely needed to upgrade everything.

Following the JParkCodes post of May 30, 2023, I tried to selfupdate MacPorts.  logged in as root, I typed

port selfupdate

This command upgraded my MacPort software from 2.10.4 to 2.10.5.  I was also advised by the selfupdate that 

The ports tree has been updated.

65 ports are outdated. Run 'port outdated' for details.

To upgrade your installed ports, you should run

  port upgrade outdated

After trying to upgrade the outdated ports, the software snagged on an update for gcc12.  I believe that this version of gcc is obsolete in Sequoia, and the proper version will be gcc14. 

sudo port install gcc14

This command executed successfully.  I needed to re-run 

  port upgrade outdated

to complete the upgrade.  However, FIRST I need to remove the gcc12 port, because the command hangs on it.

port uninstall gcc12

If an upgrade process hangs, one must kill the associated process in order to uninstall gcc12.  I lwarnewd this the hard way.

Once the gcc14 port is installed, then one must set up the aliases properly to compile Fortran and C programs.  My changes to .cshrc were the lines

alias cc            '/opt/local/bin/gcc-mp-14'

alias gcc           '/opt/local/bin/gcc-mp-14'

alias gfortran      '/opt/local/bin/gfortran-mp-14'



Thursday, November 14, 2024

Upgraded Macbook-Pro operating system from Monterey to Ventura


With the introduction of MacOS15 Sequoia, the mavens at Apple dropped support for MacOS12 Monterey.  I held on for a month or so while two updates of the Microsoft Apps came and went without my laptop able to download them.  Yesterday I tried to edit a Word file sent to me by someone.  The older software was not working well in edit mode, so I decided to upgrade everything.  I do not want to scale the heights of MacOS15 Sequoia yet, because it may introduce a new wrinkle in my legacy Fortran codes.  Consulting the Apple help pages with the Google, I determined that one can upgrade to an older system through the App Store, so I followed the link to the latest version of MacOS13 Ventura, an operating system that Apple will probably support until Fall 2025.  By then I will have upgraded my laptop to an Apple M4 chip and be digesting Sequoia on it.  Both iMacs are currently running MacOS14 Sonoma without serious problems, but I havent been developing Fortran codes on them.  So Ventura was the upgrade.

The upgrade notes from May 2023 worked successfully, installing MacPorts and then using MacPorts to install gcc12 and its gfortran code.  The only wrinkle was the need to alter one of the MacPorts auxiliary files (sources.conf) to correct a misleading weblink for software tarballs.  This file proved challenging to find on my laptop -- I needed the Google to find the breadcrumbs left by previous programmers with the same installation bug.

My altered legacy codes from 2023, changed to accommodate the syntax rules of Fortran 2018, worked OK.  When compiled, there were many warnings about arrays out of bounds, owing to the past use of the old DIMENSION B(N,1) syntax that left the number of rows in an array open.  A warning, not an error, so the codes can be used without changing all the DIMENSION statements.

In other housekeeping, I upgraded the ObsPy39 environment in Anaconda to ObsPy 1.4.1.  Not tested yet.  Need to sync with the iMacs, probably.  Anaconda itself did not nudge me to upgrade the Navigator.

 
Link