Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the process of python3 installing configuration in various server environments

Shulou Source: shulou.com Published: 2022-06-02 03:11:12 09月25日 Update

This article is to share with you about the process of installing and configuring python3 in various server environments. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.

1. Install in a server environment

Centos

Yum install python3X [X for version number]

Ubuntu

Apt-get install python3.X [X Code minor version number]

Source package compilation and installation

Step 1. First, run the following command in the terminal through apt to ensure that all system packages are up to date. Sudo apt updatesudo apt upgradesudo apt install software-properties-common step 2. Install Python 3.9 on Ubuntu 20.04. Install Python 3.9 install Python dependencies on Ubuntu from source code: sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev next download the latest version of the source code: wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgztar-xf Python-3.9.0.tgz from the Python download page and then run the configuration script The script performs a large number of checks to ensure that all dependencies on the system exist: after cd Python-3.9.0./configure-- enable-optimizations, start the Python 3.9 build process: make-j 12sudo make altinstall verify installation: python3.9-- version installs Python 3.9 on Ubuntu using apt now, we add deadsnakes PPA to your Ubuntu system: sudo add-apt-repository ppa:deadsnakes/ppa installs Pip for Python 3.9 Run the following command: sudo apt install python3.9 verifies the installation by printing the Python version number: python3.9-- version2. Create a virtual environment:

To create a virtual environment in ubuntu, you need to execute [apt install python3.9-venv]

Python3-m venv / opt/python39/myenv

3. Download source replacement

Mkdir ~ / .pip [create folder]

Vim pip.conf [open pip.conf file]

The contents are as follows:

[global] index-url= http://mirrors.aliyun.com/pypi/simple/[install]trusted-host=mirrors.aliyun.com [Ali Yunyuan, can also be replaced with other sources] 4. Activate the virtual environment

Source / opt/python39/bin/active

This is how python3 installs and configures in various server environments. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Tags: Environment version server process security service configuration system run command file more step source code knowledge article script verification utility next Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL NVidia OPPO Reno Microsoft Xiaomi