In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-10-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
There are many versions of python, and the functions of each version are quite different. In the process of using, we often encounter inconsistencies between the python version that the third-party library depends on and the version of the system. At the same time, because the bottom layer of the system needs to call the current version of python, we cannot change the python version of the system at will. In this case, multiple python versions will coexist.
So python multi-environment management tools came into being, virtualenv and Pyenv. Both Pyenv and virtualenv are python management tools, but the difference is that the former manages the version of python to switch and use different versions, while the latter chooses the market to separate the system environment and other python environments from each other by creating a virtual environment.
(1) deployment
Step 1: install the python-pip and pythondevel packages
Shell > yum install python-pip python-devel-y
Step 2: check the installation environment
/ / make sure that development environment packages such as gcc glibc are installed on the server
Shell > yum install gcc glibc-devel zlib-devel rpm-build openssl-devel-y
/ / Update pip to the latest version
Shell > pip install-- upgrde pip
Step 3: install virtualenv
Shell > pip install virtualenv
Shell > virtualenv-- version # indicates successful installation
16.7.7
(2) use
Shell > virtualenv-- help
Usage: introduction to virtualenv [OPTIONS] DEST_DIR # syntax
Step 1: create a virtual directory
Shell > virtualenv / python/python3.6.6
Step 2: create a virtual working directory
Shell > virtualenv / python/data/sof/virtualpy/
Step 3: load the environment variables through source to change the local environment to the virtual working directory
Shell > virtualenv / python/data/sof/virtualpy/bin/activate
(virtualpy) [root@oy ~] # # switched successfully, not already entered the virtual working directory
Shell > deactivate exit the virtual environment directory
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.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.