Skip to content

Commit cd7f594

Browse files
committed
Simplify virtualenv installation by using shell scripts
1 parent a73ba54 commit cd7f594

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

virtualenv_install.bat

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@ECHO OFF
2+
:: Performs necessary setup steps to allow the use of
3+
:: virtualenv commands such as "mkvirtualenv [ENV_NAME]"
4+
:: for creating and using Python virtual environments.
5+
6+
python -m pip install --upgrade virtualenv
7+
python -m pip install --upgrade virtualenvwrapper-win
8+
echo ""
9+
echo ""
10+
echo "*** You may now use virtualenv commands in your command shell. ***"
11+
echo ""
12+
echo "virtualenv commands:"
13+
echo " * 'mkvirtualenv [ENV_NAME]' - Create a Python virtual environment"
14+
echo " * 'deactivate' - Exit the current virtual environment"
15+
echo " * 'workon [ENV_NAME]' - Enter an existing virtual environment"
16+
echo " * 'lsvirtualenv' OR 'workon' - List all virtual environments"
17+
echo " * 'rmvirtualenv [ENV_NAME]' - Delete a virtual environment"
18+
echo ""
19+
echo "Example:"
20+
echo " mkvirtualenv seleniumbase "
21+
echo ""

virtualenv_install.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Performs necessary setup steps to allow the use of
2+
# virtualenv commands such as "mkvirtualenv [ENV_NAME]"
3+
# for creating and using Python virtual environments.
4+
#
5+
# Run by using the following command: "source virtualenv_install.sh"
6+
7+
python -m pip install --upgrade virtualenv
8+
python -m pip install --upgrade virtualenvwrapper
9+
source `which virtualenvwrapper.sh`
10+
export WORKON_HOME=$HOME/.virtualenvs
11+
echo ""
12+
echo ""
13+
echo 'virtualenv commands will only work if you installed this using "source":'
14+
echo ' *** "source virtualenv_install.sh" ***'
15+
echo ""
16+
echo ""
17+
echo "*** You may now use virtualenv commands in your command shell. ***"
18+
echo ""
19+
echo "virtualenv commands:"
20+
echo ' * "mkvirtualenv [ENV_NAME]" - Create a Python virtual environment'
21+
echo ' * "deactivate" - Exit the current virtual environment'
22+
echo ' * "workon [ENV_NAME]" - Enter an existing virtual environment'
23+
echo ' * "lsvirtualenv" OR "workon" - List all virtual environments'
24+
echo ' * "rmvirtualenv [ENV_NAME]" - Delete a virtual environment'
25+
echo ""
26+
echo "Example:"
27+
echo " mkvirtualenv seleniumbase "
28+
echo ""

0 commit comments

Comments
 (0)