On December 28, 2020, the Macbook Air with M1 arrived. Since it is an M1 and a hobby Mac, I decided to improve the usage environment without using Rosetta 2.
First, install Google Chrome (browser) and CotEditor (text editor) that support M1 (Apple Silicon). Next is the installation of Python in question. I tried two methods as the method I checked in advance.
As a result, using Miniforge3 made it relatively easy to create the equivalent of what I used to use on my iMac. The iMac python environment is created with pyenv, but I haven't used it to switch between multiple versions. When pip and pyenv start running on M1, I'll start over there.
TeX seems to be compatible with Apple silicon, so I tried installing BasicTeX.
I abandoned the installation of both of the above because I was asked to install Rosetta 2 on the way. It does not mean "cannot be installed", but it means "cannot be installed" because it is contrary to this idea because it cannot be installed without installing Rosetta 2.
The first is to install Python from Homebrew. I tried according to the following.
https://dev.classmethod.jp/articles/make-3-9-as-python-default-on-m1-mac/
I was able to install Homebew and Python 3.9 smoothly. But numpy, matplotlib doesn't work with pip,
I tried putting numpy from Homebrew, but numpy is OK, but it doesn't follow, such as installing matplotlib with pip. In addition, it seems that GCC (gfortran) and openblas will be installed at the same time as numpy. I uninstalled numpy and openblas, but got gfortran. The version confirmation result of gfortran is as follows.
(base) % gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/opt/homebrew/Cellar/gcc/10.2.0/libexec/gcc/aarch64-apple-darwin20/10.2.1/lto-wrapper
Target: aarch64-apple-darwin20
Configured with: ../configure --build=aarch64-apple-darwin20 --prefix=/opt/homebrew/Cellar/gcc/10.2.0 --libdir=/opt/homebrew/Cellar/gcc/10.2.0/lib/gcc/10 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-10 --with-gmp=/opt/homebrew/opt/gmp --with-mpfr=/opt/homebrew/opt/mpfr --with-mpc=/opt/homebrew/opt/libmpc --with-isl=/opt/homebrew/opt/isl --with-system-zlib --with-pkgversion='Homebrew GCC 10.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk SED=/usr/bin/sed
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.1 20201220 (Homebrew GCC 10.2.0)
(base) %
The second is done as written, referring to the following site.
Get the script for arm64 (Apple Silicon) from https://github.com/conda-forge/miniforge and execute it.
bash Miniforge3-MacOSX-arm64.sh
After that, create an environment called `myenv`
and install what you want steadily. This `` `myenv``` can be any name you like. I followed the example of my predecessor and gave it the same name.
conda create -n myenv python=3.9
conda activate myenv
conda install numpy
conda install matplotlib
conda install sciPy
conda install pandas
conda install scikit-learn
conda install openpyxl
conda install jupyterlab
myenv
Is activated and put inimport
Check if you can. .. .. OK. of coursejupyter notebook
Also works.
(base) % conda activate myenv
(myenv) % python
Python 3.9.1 | packaged by conda-forge | (default, Dec 21 2020, 22:08:11)
[Clang 11.0.0 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import matplotlib
>>> import scipy
>>> import pandas
>>> import sklearn
>>> import openpyxl
>>> quit()
(myenv) %
openpyxl
Is put, but ms-There is no problem even if there is no office. You can read the excel file created in the past, and you can check the contents of the output in excel format with the numbers that come standard with mac.
I bought Microsoft 365 on January 14th. At this point, it is compatible with Apple silicon and installed without any problems. The behavior is also stable.
Here is a photo showing that the Jupyter notebook is running. Since it is a demo, I tried to display the screen of Jupyter notebook on iPad Air with Sidecar.
that's all
Recommended Posts