@@ -15,28 +15,45 @@ pip --version
1515virtualenv --version
1616
1717
18- # 1. Set up Conda ----
19- # install [2]
20- mkdir -p ~ /miniconda3
21- wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~ /miniconda3/miniconda.sh
22- bash ~ /miniconda3/miniconda.sh -b -u -p ~ /miniconda3
23-
24- ~ /miniconda3/bin/conda init bash
18+ # 1. Set up Conda [2] ----
19+ # Detect OS and architecture
20+ OS_NAME=" $( uname -s) "
21+ ARCH_NAME=" $( uname -m) "
22+
23+ if [[ " $OS_NAME " == " Darwin" && " $ARCH_NAME " == " arm64" ]]; then
24+ echo " Detected macOS (Apple Silicon). Installing Miniconda for arm64..."
25+ curl -fsSLo ~ /miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh
26+ bash ~ /miniconda.sh -b -p $HOME /miniconda
27+ $HOME /miniconda/bin/conda init zsh
28+ rm ~ /miniconda.sh
29+ elif [[ " $OS_NAME " == " Linux" ]]; then
30+ echo " Detected Linux. Installing Miniconda for x86_64..."
31+ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~ /miniconda.sh
32+ bash ~ /miniconda.sh -b -p $HOME /miniconda
33+ $HOME /miniconda/bin/conda init bash
34+ rm ~ /miniconda.sh
35+ else
36+ echo " Unsupported OS or architecture: $OS_NAME $ARCH_NAME "
37+ exit 1
38+ fi
2539
2640# validate
27- conda update conda
2841conda --version
2942
3043# config conda and channels
44+ conda config --set always_yes true
45+ conda config --set env_prompt ' [{name}]'
46+ conda config --set pip_interop_enabled true
3147conda config --set auto_activate_base false
48+ conda config --set show_channel_urls true
49+ conda config --set channel_priority strict
3250
51+ # Prioritize conda-forge for latest DS packages
52+ conda config --remove-key channels || true # Remove all channels to reset priority
53+ conda config --add channels conda-forge
3354conda config --add channels defaults
3455conda config --add channels bioconda
35- conda config --add channels conda-forge
36- conda config --add channels Microsoft # if you like Azure :)
37-
38- conda config --set show_channel_urls true
39- conda config --set channel_priority flexible
56+ conda config --add channels Microsoft
4057
4158# show all configs
4259conda config --show
@@ -46,7 +63,8 @@ conda config --show
4663NEW_ENV=" <env_name>" ; readonly NEW_ENV
4764PYTHON_VERSION=3.13; readonly PYTHON_VERSION
4865
49- conda create -n $NEW_ENV python=$PYTHON_VERSION
66+ # Create environment -- with common DS tools (uncomment if needed)
67+ conda create -n $NEW_ENV python=$PYTHON_VERSION # numpy pandas scipy scikit-learn matplotlib seaborn jupyterlab ipykernel
5068conda env list
5169
5270# activate new environment
@@ -74,7 +92,8 @@ conda update --all --yes
7492pip install --upgrade pip
7593
7694# remove conda env
77- conda remove -n $NEW_CONDA_ENV -all
95+ conda remove -n $NEW_ENV -all
96+
7897
7998# 4. Linting ----
8099pip install pylint
0 commit comments