Python Environment setup

Source: Internet
Author: User
Tags virtual environment virtualenv install redis aliyun

Pyenv is a tool that can easily be toggled in multiple versions of Python


Official website: https://github.com/pyenv/pyenv

? Pyenv has the following features:
Make a global python version switch
Provide a Python version for a single project
Using environment variables allows you to rewrite the Python version
Ability to perform command searches between different versions at the same time
? Has the following characteristics:
Depends only on Python itself
Add directories to $path to use
Ability to perform VIRTUALENV management

Pyenv Installation Method
1 pyenv Installing Git
Yum Install Git-y
2 Python installation dependencies
Yum-y install gcc make patch gdbm-devel openssl-devel sqlite-devel readline-devel zlib-devel bzip2-devel
3 Creating a User Python
Useradd python
passwd python
4 signing in with a Python user
Curl-l Https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | Bash
5 Modify the. bash_profile file in the home directory. When the user starts, the script in. Bash_profile is executed and the pyenv is started.
? Add to
0export path= "/home/python/.pyenv/bin: $PATH"
0eval "$ (pyenv init =)"
0eval "$ (pyenv virtualenv-init-)"
? Source
0source ~/.bash_profile
6 Viewing the Python version
? Python-v
7 pyenv function
? Pyenv Help Install
? Pyenv Install--list View installable version
? Pyenv Install 3.5.3-V View version 3.5.3 and view installation details
? Pyenv version View pyenv versions
? Pyenv versions view pyenv all versions
? PYENV Global 3.5.3 All windows that are logged in with a Python user are set (disabled)
? PYENV Global System
? Pyenv Shell 3.5.3 affects the current window only, session close setting ends
? Engineering
0mkdir mage/projects-p
0CD mage/projects
0pyenv local 3.5.3 Use 3.5.3 version under Mage/projects folder, subdirectory inherits Python version
0pyenv version View release information
? Create a separate virtual space using python3.5.3 *
0mkdir Mage/projects/web
0CD Mage/projects/web
0pyenv virtualenv 3.5.3 mage353 Setting the Web Directory virtual Environment version mage353
0pyenv local mage353 Set directory version
0pyenv versions View
? Understand:
0PENV Environmental Isolation
0VIRTUALENV Package Management
Pip
? PIP-V View Package Management directory
? PIP configuration file:
0mkdir. Pip
0CD. Pip
0vim pip.conf
§[global]
§index-url=https://mirrors.aliyun.com/pypi/simple/
§trusted-host=mirrors.aliyun.com
? Pip Install Redis
? Pip Install Ipython Editing Tool
? Pip Install Jupyter Web Edition Editing Tool

? Development environment and production environment package synchronization
0PIP Freeze > Requirement
0PIP install-r Requirement
? Pycharm
0https://www.jetbrains.com/pycharm/
? Python
0https://www.python.org/

? Python interpreter
0Cpython
0Ipython: Enhanced CPython
0pypy:python-Written interpreter
0Jython: The python source code is mutated into Java bytecode, running on the JVM
0IronPython:.

Python Environment setup

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.