Skip to content

Commit 38732e5

Browse files
committed
[brew] - Integrate brew python as pyenv version
1 parent 5a86e19 commit 38732e5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

brew/brew_pyenv

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
PYVER=$(brew list --versions python | cut -d ' ' -f2)
3+
PYMIN=$(echo "$PYVER" | cut -d. -f1,2)
4+
PYPKG=$(echo "python@$PYMIN")
5+
6+
7+
# Uninstall pyenv version
8+
echo "Uninstalling $PYVER ..."
9+
pyenv uninstall $PYVER
10+
pyenv rehash
11+
12+
# Create version symlink
13+
cd ~/.pyenv/versions
14+
ln -sfv "$(brew --prefix $PYPKG)" $PYMIN
15+
16+
# Link include folder
17+
cd "$(brew --prefix $PYPKG)"
18+
ln -sfv Frameworks/Python.framework/Versions/$PYMIN/include/python$PYMIN include
19+
20+
# Link executable commands
21+
cd "$(brew --prefix $PYPKG)/bin"
22+
ln -sfv idle3 idle
23+
ln -sfv pip3 pip
24+
ln -sfv python3 python
25+
ln -sfv wheel3 wheel
26+
27+
# Rehash
28+
pyenv rehash
29+

0 commit comments

Comments
 (0)