#-------------------------------------------------------------------------------
#  [1] Homebrew initialization:
#
#      The three packages 1) Python, 2) Ruby and 3) Qt5 are required.
#-------------------------------------------------------------------------------
   % brew install qt5
   % brew install python@3.8
   % brew install ruby@2.7

#-------------------------------------------------------------------------------
#  [2] Installation process of different Python modules using 'pip':
#
#       Catalina3{kazzz-s} ~ (1)% brew info python
#       python@3.8: stable 3.8.5 (bottled)
#       Interpreted, interactive, object-oriented programming language
#       https://www.python.org/
#       /usr/local/Cellar/python@3.8/3.8.5 (4,367 files, 67.7MB)
#         Poured from bottle on 2020-09-13 at 18:58:27
#       From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/python@3.8.rb
#       License: Python-2.0
#       ==> Dependencies
#       Build: pkg-config ✘
#       Required: gdbm ✔, openssl@1.1 ✔, readline ✔, sqlite ✔, xz ✔
#       ==> Caveats
#       Python has been installed as
#         /usr/local/bin/python3
#
#  ==>  Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
#  ==>  `python3`, `python3-config`, `pip3` etc., respectively, have been installed into
#  ==>    /usr/local/opt/python@3.8/libexec/bin
#
#       You can install Python packages with
#         pip3 install <package>
#       They will install into the site-package directory
#         /usr/local/lib/python3.8/site-packages
#
#       See: https://docs.brew.sh/Homebrew-and-Python
#       ==> Analytics
#       install: 446,775 (30 days), 1,594,986 (90 days), 3,044,861 (365 days)
#       install-on-request: 158,389 (30 days), 414,911 (90 days), 463,266 (365 days)
#       build-error: 0 (30 days)
#-------------------------------------------------------------------------------
Catalina3{kazzz-s} ~ (1)% ls -al `which pip`
lrwxr-xr-x  1 kazzz-s  staff  37 May 21 18:19 /Users/kazzz-s/bin/pip -> /usr/local/opt/python/libexec/bin/pip


Catalina3{kazzz-s} ~ (2)% pip list (very beginning)
Package    Version
---------- -------
pip        20.1.1
setuptools 49.2.0
wheel      0.34.2

Catalina3{kazzz-s} ~ (3)% pip install numpy
Collecting numpy
  Downloading numpy-1.19.2-cp38-cp38-macosx_10_9_x86_64.whl (15.3 MB)
     |████████████████████████████████| 15.3 MB 1.9 MB/s
Installing collected packages: numpy
Successfully installed numpy-1.19.2


Catalina3{kazzz-s} ~ (4)% pip list
Package    Version
---------- -------
numpy      1.19.2
pip        20.1.1
setuptools 49.2.0
wheel      0.34.2


Catalina3{kazzz-s} ~ (5)% pip install scipy
Collecting scipy
  Downloading scipy-1.5.2-cp38-cp38-macosx_10_9_x86_64.whl (28.9 MB)
     |████████████████████████████████| 28.9 MB 1.6 MB/s
Requirement already satisfied: numpy>=1.14.5 in /usr/local/lib/python3.8/site-packages (from scipy) (1.19.2)
Installing collected packages: scipy
Successfully installed scipy-1.5.2


Catalina3{kazzz-s} ~ (6)% pip list
Package    Version
---------- -------
numpy      1.19.2
pip        20.1.1
scipy      1.5.2
setuptools 49.2.0
wheel      0.34.2


Catalina3{kazzz-s} ~ (7)% pip install matplotlib
Collecting matplotlib
  Downloading matplotlib-3.3.1-cp38-cp38-macosx_10_9_x86_64.whl (8.5 MB)
     |████████████████████████████████| 8.5 MB 2.7 MB/s
Collecting certifi>=2020.06.20
  Downloading certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
     |████████████████████████████████| 156 kB 1.7 MB/s
Collecting python-dateutil>=2.1
  Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting cycler>=0.10
  Using cached cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Collecting kiwisolver>=1.0.1
  Downloading kiwisolver-1.2.0-cp38-cp38-macosx_10_9_x86_64.whl (60 kB)
     |████████████████████████████████| 60 kB 3.1 MB/s
Requirement already satisfied: numpy>=1.15 in /usr/local/lib/python3.8/site-packages (from matplotlib) (1.19.2)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3
  Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting pillow>=6.2.0
  Downloading Pillow-7.2.0-cp38-cp38-macosx_10_10_x86_64.whl (2.2 MB)
     |████████████████████████████████| 2.2 MB 1.8 MB/s
Collecting six>=1.5
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: certifi, six, python-dateutil, cycler, kiwisolver, pyparsing, pillow, matplotlib
Successfully installed certifi-2020.6.20 cycler-0.10.0 kiwisolver-1.2.0 matplotlib-3.3.1 pillow-7.2.0 pyparsing-2.4.7 python-dateutil-2.8.1 six-1.15.0


Catalina3{kazzz-s} ~ (8)% pip list
Package         Version
--------------- ---------
certifi         2020.6.20
cycler          0.10.0
kiwisolver      1.2.0
matplotlib      3.3.1
numpy           1.19.2
Pillow          7.2.0
pip             20.1.1
pyparsing       2.4.7
python-dateutil 2.8.1
scipy           1.5.2
setuptools      49.2.0
six             1.15.0
wheel           0.34.2


Catalina3{kazzz-s} ~ (9)% pip install pandas
Collecting pandas
  Downloading pandas-1.1.2-cp38-cp38-macosx_10_9_x86_64.whl (10.6 MB)
     |████████████████████████████████| 10.6 MB 3.2 MB/s
Collecting pytz>=2017.2
  Using cached pytz-2020.1-py2.py3-none-any.whl (510 kB)
Requirement already satisfied: numpy>=1.15.4 in /usr/local/lib/python3.8/site-packages (from pandas) (1.19.2)
Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.8/site-packages (from pandas) (2.8.1)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.8/site-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)
Installing collected packages: pytz, pandas
Successfully installed pandas-1.1.2 pytz-2020.1


Catalina3{kazzz-s} ~ (10)% pip list (before the import test below)
Package         Version
--------------- ---------
certifi         2020.6.20
cycler          0.10.0
kiwisolver      1.2.0
matplotlib      3.3.1
numpy           1.19.2
pandas          1.1.2
Pillow          7.2.0
pip             20.1.1
pyparsing       2.4.7
python-dateutil 2.8.1
pytz            2020.1
scipy           1.5.2
setuptools      49.2.0
six             1.15.0
wheel           0.34.2


#-------------------------------------------------------------------------------
#  [3] Python module import test:
#
#      Run this sample python from "Macro Development" with such a sample CSV.
#-------------------------------------------------------------------------------
'''
# Enter your Python code here
import os
import numpy as np
import scipy
import matplotlib
import pandas as pd

sampleCSV = os.environ["HOME"] + "/KLayout/sampleCSV.csv"
df = pd.read_csv( sampleCSV, comment='#' )
print(df)
'''

== Output ==
      X[mm]  Y[mm]   Ratio[]
0       0.0    3.1  1.006617
1       2.7   -1.5  1.006607
2      -2.7   -1.5  1.006321
3       0.0    9.2  1.006651
4       5.9    7.0  1.006211
...     ...    ...       ...
1805  -30.3  140.7  0.994904
1806  -24.3  141.9  0.994266
1807  -18.3  142.8  0.994888
1808  -12.2  143.4  0.994146
1809   -6.1  143.8  0.993552

[1810 rows x 3 columns]

#------------------
# End of File
#------------------
