• Aucun résultat trouvé

Installing Python on Linux

N/A
N/A
Protected

Academic year: 2022

Partager "Installing Python on Linux"

Copied!
3
0
0

Texte intégral

(1)

Throughout this document, we will:

1. Install Python 3.8.0

2. Create a virtual environment using this version of Python.

3. Inside this environment, install useful packages.

This approach works well and is straightforward to set up, but has its drawbacks. For those who feel more comfortable with the command line, we also provide instructions for a better solution involving a tool named virtualenvwrapper . In this portion, we will

1. Reset our environment to the default state.

2. Use Python 3.8.0's pip to install virtualenvwrapper

3. Use virtualenvwrapper to create a managed virtual environment.

4. Inside this environment, install useful packages.

5. Modify the shell startup script to activate this virtual environment.

Let's get started!

We assume that you have a basic familiarity with the command line.

On different Linux systems, there are a couple of different ways to install and manage packages. We'll cover apt-get here, as well as how you can install from source.

apt-get is Linux's Advanced Package Tool, and is very useful for installing, managing, upgrading, and removing packages on Debian, Ubuntu, and a few other Linux distributions.

We'll use Felix Krull's PPA to install specific Python versions.

Installing Python on Linux

Overview

Prerequisite

Install Python 3.8.0

Installing with apt-get (Ubuntu, Debian)

(2)

$ sudo add-apt-repository ppa:deadsnakes/ppa

$ sudo apt-get update

$ sudo apt-get install python3.8

$ sudo apt-get install python3.8-venv

On Debian, we'll just have to sudo apt-get install python3 and hope for the best.

Also note that this might install a different version of Python 3.8, but we won't worry about that here.

Other Linux distributions use a different package manager, yum . We don't have any test devices with these Linux distributions, so you're on your own here. There is a reasonably good tutorial for CentOS here.

The world of Linux distributions is unfathomably large. If you can pull off a Python 3.8 install on your distribution of choice, more power to you. However, we recommend building from source.

Installing Python from source follows the same pattern as most other source installations.

First, download the source tarball (either gzipped or XZ compressed). Unzip the files and cd into the unzipped directory.

To build Python, just execute the usual commands:

$ ./configure

$ make

$ make test

$ sudo make install

Note: If you want to install Python to a non-standard location, you can

./configure --prefix=/some/other/directory in order to, say, not overwrite a system-installed Python, which might be useful for distributions like CentOS

Much of this guide was based on a similar handout written by Sam Redmond.

Installing with yum (RedHat, CentOS)

Other Linux package managers

Installing from source

Credit

(3)

Références

Documents relatifs

Antes de instalar vamos a asegurarnos de que tenemos activado el repositorio de terceros (origen de software de otros que no sean Ubuntu), para ello: Sistema – Administración –

В данном окне выберите рекомендованный драйвер и нажмите Активировать (т.к. у меня этот драйвер активирован, то вместо

For example, the file for the useradd command defines the default group number, home directory, password expiration date, shell, and skeleton directory ( /etc/skel ) that are used

– si vous comptez faire cohabiter Windows et Linux sur le même ordinateur, gardez tous ces fichiers dans un répertoire tempo- raire de votre partition Windows.. – sinon, copiez tous

If you decide you want to move all messages in your Inbox from a particular person to a different folder, for example, you can open the Message Filters window, create a rule to

RedBoot apporte des fonctions intéressantes concernant des points comme le démarrage d’un système via réseau (bootp et tftpboot), la gestion de la mémoire flash, le télécharge-

Because choosing and using a window manager with X11 is a matter of personal preference, this hour will show you how to configure KDE using the KDE Control Center to change

This chapter walks through two graphical text editors, the gedit text editor and the emacs editor, as well vim, an old-fashioned text-based editor you can use when working in