Skip to content

Commit e51453c

Browse files
authored
Merge pull request #15 from codez0mb1e/macos-support-updates
MacOS support updates
2 parents cebb21b + a6af047 commit e51453c

2 files changed

Lines changed: 36 additions & 17 deletions

File tree

development/install_ds_python.sh

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,45 @@ pip --version
1515
virtualenv --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
2841
conda --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
3147
conda 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
3354
conda config --add channels defaults
3455
conda 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
4259
conda config --show
@@ -46,7 +63,8 @@ conda config --show
4663
NEW_ENV="<env_name>"; readonly NEW_ENV
4764
PYTHON_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
5068
conda env list
5169

5270
# activate new environment
@@ -74,7 +92,8 @@ conda update --all --yes
7492
pip 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 ----
8099
pip install pylint

ubuntu-os/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
- [Cookies](#cookies)
1111
- [References](#references)
1212

13-
1413
## Discover
1514

1615
OS info:
@@ -20,6 +19,7 @@ uname -a
2019
```
2120

2221
Hardware info:
22+
2323

2424
```bash
2525
lscpu | grep "Model name" # CPU
@@ -113,7 +113,7 @@ cd ~/.ssh
113113
ls -l .
114114

115115
# generate new keys pair (if necessary)
116-
ssh-keygen -t rsa -b 4096 -f $KEY_NAME -C $USR
116+
ssh-keygen -t ed25519 -f $KEY_NAME -C $USR
117117

118118
# View public key
119119
cat $KEY_NAME.pub

0 commit comments

Comments
 (0)