Skip to content

Instantly share code, notes, and snippets.

@mgoodfellow mgoodfellow/venv_init.sh
Last active Mar 7, 2017

Embed
What would you like to do?
Quick script to create venv with patched pip version on Python 3.6 on Windows
#!/bin/bash
# This is a handy script to apply a pip fix to the venv created by python 3.6 on Windows
# Written by Mike Goodfellow in a few minutes - feel free to improve this!!
# Based on information in https://github.com/pypa/pip/issues/3964
#
# NOTE: Currently works if python on path points to python3 which is commonly
# does on Windows.
if [ $# -ne 1 ]
then
echo "Usage: venv_init /path/to/venv"
exit 1
fi
echo "Creating new venv in $1..."
# NOTE: This needs to be on the path...
python -m venv $1
echo "Applying the pip fix..."
rm -rf $1/Lib/site-packages/pip*
$1/Scripts/easy_install pip
$1/Scripts/pip install --upgrade pip setuptools
echo "Patched version of venv has been configured in $1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.