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.
No comments:
Post a Comment