Differences between revisions 3 and 7 (spanning 4 versions)
Revision 3 as of 2019-12-07 17:08:18
Size: 1696
Comment:
Revision 7 as of 2021-11-20 22:05:16
Size: 1596
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= System Installation = = Python Installation =
Line 3: Line 3:
== Arch == '''Python''' is a scripting language that is unfortunately used as a systems language.

<<TableOfContents>>

----


== Windows ==

----



== macOS ==

`brew`

----



== Linux ==

=== Arch Linux ===

On '''Arch Linux''' systems, `python` points to the most recent version. Older versions are available on the AUR as `python37`, `python36`, `python26`, etc.

Major libraries are offered as packages and should be preferred over [[Python/Pip|manual installation]].
Line 7: Line 34:
# or, sudo pacman -Syyu python2 python2-pip python2-setuptools
Line 9: Line 35:

Older versions are available on the AUR as `python37`, `python36`, `python26`, etc.
Line 14: Line 38:
== Debian == === Debian ===

On '''Debian''' systems, use `python3` rather than `python`. This operating system supported (and used) both Python 2 and Python 3 for an extended period of time, leading to widespread use of shebang lines as the method of dispatching to the correct executable.

Debian vendors Python heavily. Namely, they patch out the `ensurepip` module to enforce `apt` package control.
Line 18: Line 46:
# or, sudo apt install python python-virtualenv python-venv python-setuptools python-pip
Line 20: Line 47:

Debian patches out the `ensurepip` module to enforce `apt` package control.
Line 25: Line 50:
== Ubuntu == === Ubuntu ===
Line 27: Line 52:
A default version of Python should work out-of-the-box. For alternate versions, use the deadsnakes PPA: '''Ubuntu''' inherits the problems of Debian. The deadsnakes PPA provides alternate versions of Python with versioned names.
Line 32: Line 57:
sudo apt install python#.# sudo apt install python3.8
Line 34: Line 59:

----
Line 37: Line 64:
= Environment Setup =

== Python Path ==
== Configuration ==
Line 42: Line 67:

Python has the ability to import modules from a zip archive, if the file's path is on `$PATH`.
Line 49: Line 72:
== 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
}}}


Python Installation

Python is a scripting language that is unfortunately used as a systems language.


Windows


macOS

brew


Linux

Arch Linux

On Arch Linux systems, python points to the most recent version. Older versions are available on the AUR as python37, python36, python26, etc.

Major libraries are offered as packages and should be preferred over manual installation.

sudo pacman -Syyu python python-pip python-setuptools

Debian

On Debian systems, use python3 rather than python. This operating system supported (and used) both Python 2 and Python 3 for an extended period of time, leading to widespread use of shebang lines as the method of dispatching to the correct executable.

Debian vendors Python heavily. Namely, they patch out the ensurepip module to enforce apt package control.

sudo apt install python3 python3-virtualenv python3-venv python3-setuptools python3-pip

Ubuntu

Ubuntu inherits the problems of Debian. The deadsnakes PPA provides alternate versions of Python with versioned names.

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt install python3.8


Configuration

The python interpretor looks for modules on $PATH, appending its own libraries. Additional appends can be set in $PYTHONPATH.

A startup script can be set with $PYTHONSTARTUP.


CategoryRicottone

Python/Installation (last edited 2021-11-20 22:05:16 by DominicRicottone)