forked from driesvints/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
python.sh
58 lines (44 loc) · 1.69 KB
/
python.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
echo 'installing pyenv and configuring to use with zsh'
# Check if pyenv is installed and install if we don't have it
if test ! $(which pyenv); then
brew install pyenv
fi
if ! grep -q 'eval "$(pyenv init --path)"' ~/.zprofile; then
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
fi
if ! grep -q 'eval "$(pyenv init -)"' ~/.zshrc; then
echo '#### PYENV INIT ####' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
fi
if ! grep -q 'eval "$(pyenv virtualenv-init -)"' ~/.zshrc; then
echo '#### PYENV VIRTUALENV INIT ####' >> ~/.zshrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc
fi
# Check for Homebrew and install if we don't have it
if test ! $(which brew); then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
echo "installing pipx to help install & run end-user applications"
brew install pipx
pipx ensurepath
echo "installing pipenv"
pipx install pipenv
pipx ensurepath
echo 'installing the following pyenv versions: 3.10.2, anaconda3-2021.11'
pyenv install 3.11
pyenv install anaconda3-2022.05
pyenv global 3.10.7 # set as python global
echo 'running brew cleanup; brew doctor'
brew cleanup
brew doctor
echo 'Finished installing pyenv. Double check that pyenv was injected in .zprofile and .zshrc'
## Install Java versions
echo 'Installing Java + Jenv for Java version management.'
echol 'Look up `jenv` for steps on how to add versions'
brew install 'jenv'
brew install 'java'
echo '#### JAVA ENV MANAGER ####' >> ~/.zshrc
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(jenv init -)"' >> ~/.zshrc