Skip to content

Commit

Permalink
set gpip for global pip
Browse files Browse the repository at this point in the history
  • Loading branch information
zy9306 committed Nov 7, 2023
1 parent 54db25a commit 1aa1450
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dotfiles/zsh/.env
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,18 @@ if [ -z "$VIRTUALENVWRAPPER_PYTHON_VERSION" ]; then
export VIRTUALENVWRAPPER_PYTHON_VERSION=3.10
fi

if [ -z "$MAIN_PYTHON_VERSION" ]; then
export MAIN_PYTHON_VERSION=3.10
fi

if [[ $(uname -s) == 'Darwin' ]]; then
for py_version in {"3.6","3.8","3.10"}; do
prepend_path "/Library/Frameworks/Python.framework/Versions/${py_version}/bin"
done
prepend_path "/Users/$USER/Library/Python/3.10/bin"

alias gpip="/Library/Frameworks/Python.framework/Versions/${MAIN_PYTHON_VERSION}/bin/pip"

TMP=/Library/Frameworks/Python.framework/Versions/${VIRTUALENVWRAPPER_PYTHON_VERSION}/bin/python${VIRTUALENVWRAPPER_PYTHON_VERSION}
if [ -f $TMP ]; then
export VIRTUALENVWRAPPER_PYTHON=$TMP
Expand All @@ -73,6 +79,10 @@ if [[ $(uname -s) == "Linux" ]]; then
if [ -f /usr/local/bin/python${VIRTUALENVWRAPPER_PYTHON_VERSION} ]; then
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python${VIRTUALENVWRAPPER_PYTHON_VERSION}
fi

if [ -f /usr/local/bin/python${MAIN_PYTHON_VERSION} ]; then
alias gpip="/usr/local/bin/python${MAIN_PYTHON_VERSION} -m pip"
fi
fi

if [[ $(command_exists virtualenvwrapper.sh) == true ]]; then
Expand Down

0 comments on commit 1aa1450

Please sign in to comment.