Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report