|
Size: 840
Comment:
|
Size: 1696
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 39: | Line 39: |
| == Python Path == The python interpretor looks for modules on `$PATH`, appending its own libraries. Additional appends can be set in `$PYTHONPATH`. Python has the ability to import modules from a zip archive, if the file's path is on `$PATH`. A startup script can be set with `$PYTHONSTARTUP`. == Pip == Packages installed globally are found in `/usr/lib/python#.#/site-packages`; packages installed for a user are found in `~/.local/lib/python#.#/site-packages`. Virtual environments created by pipx are found in `~/.local/pipx`; executables are installed to `~/.local/bin`. These are configurable by `$PIPX_HOME` and `PIPX_BIN_DIR` respectively. Pip will noisily complain about the format of its output changing years ago. To suppress the complaint, explicitly set the default behavior: {{{ export PIP_FORMAT=columns }}} |
System Installation
Arch
sudo pacman -Syyu python python-pip python-setuptools # or, sudo pacman -Syyu python2 python2-pip python2-setuptools
Older versions are available on the AUR as python37, python36, python26, etc.
Debian
sudo apt install python3 python3-virtualenv python3-venv python3-setuptools python3-pip # or, sudo apt install python python-virtualenv python-venv python-setuptools python-pip
Debian patches out the ensurepip module to enforce apt package control.
Ubuntu
A default version of Python should work out-of-the-box. For alternate versions, use the deadsnakes PPA:
sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get update sudo apt install python#.#
Environment Setup
Python Path
The python interpretor looks for modules on $PATH, appending its own libraries. Additional appends can be set in $PYTHONPATH.
Python has the ability to import modules from a zip archive, if the file's path is on $PATH.
A startup script can be set with $PYTHONSTARTUP.
Pip
Packages installed globally are found in /usr/lib/python#.#/site-packages; packages installed for a user are found in ~/.local/lib/python#.#/site-packages.
Virtual environments created by pipx are found in ~/.local/pipx; executables are installed to ~/.local/bin. These are configurable by $PIPX_HOME and PIPX_BIN_DIR respectively.
Pip will noisily complain about the format of its output changing years ago. To suppress the complaint, explicitly set the default behavior:
export PIP_FORMAT=columns
