Skip to content

Instantly share code, notes, and snippets.

@andy-zam
andy-zam / gist:041d57c768d9aa65c2d2794c2d899654
Created August 20, 2018 13:05 — forked from datagrok/gist:2199506
Virtualenv's `bin/activate` is Doing It Wrong

Virtualenv's bin/activate is Doing It Wrong

I'm a Python programmer and frequently work with the excellent [virtualenv][] tool by Ian Bicking.

Virtualenv is a great tool on the whole but there is one glaring problem: the activate script that virtualenv provides as a convenience to enable its functionality requires you to source it with your shell to invoke it. The activate script sets some environment variables in your current environment and defines for you a deactivate shell function which will (attempt to) help you to undo those changes later.

This pattern is abhorrently wrong and un-unix-y. activate should instead do what ssh-agent does, and launch a sub-shell or sub-command with a modified environment.

Problems

@andy-zam
andy-zam / python3.sh
Created August 20, 2018 10:38
python3 tooling (pip and venv) on Ubuntu
# you can install pip and venv through using:
# sudo apt install -y python3-pip python3-venv
# but there's no need, you can set up a venv but using only python3 itself:
python3 -m venv newEnvironment name
# this gets you a full venv along with pip:
. ./newEnvironment/bin/activate.fish
pip --version
# pip 9.0.1 from /home/andy/src/newEnvironment/lib/python3.6/site-packages (python 3.6)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00