Last active
February 28, 2020 05:04
-
-
Save odoku/80c131ef26e1d537847114611570c4e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
# Install PyEnv | |
if [ ! -e ~/.pyenv ]; then | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile | |
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile | |
fi | |
# Install virtualenv | |
set +e | |
virtualenv --version 2>&1 | grep 16.7.10 > /dev/null | |
RESULT=$? | |
set -e | |
if [ $RESULT -ne 0 ]; then | |
pip install -U virtualenv==16.7.10 | |
fi | |
# Install Pipenv | |
set +e | |
which pipenv > /dev/null | |
RESULT=$? | |
set -e | |
if [ $RESULT -ne 0 ]; then | |
pip install pipenv | |
fi | |
cat << EOS | |
Start Pipenv | |
pipenv --python | |
Install modules | |
pipenv install PyYAML | |
pipenv install # Install with Pipfile | |
pipenv install -r requirement.txt # Install with requirement.txt | |
pipenv install --dev flake8 # For development | |
Uninstall modules | |
pipenv uninstall PyYAML | |
pipenv uninstall --dev flake8 | |
Start virtual environment | |
pipenv shell | |
Exit virtual environment | |
exit (or ctrl+d) | |
Remove virtual environment | |
pipenv --rm | |
EOS |
Author
odoku
commented
Feb 28, 2020
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment