Ubuntu 10.10 Installation and use Pythonbrew Introduction

Source: Internet
Author: User

http://blog.csdn.net/nuccch/article/details/17595161

First, install the Pythonbrew

Multi-version Python management is implemented through the Pythonbrew tool, with Pythonbrew installed first.

Ensure that the system has the following packages before installation

sudo apt-get install Curl build-essential libbz2-dev libsqlite3-dev zlib1g-dev libxml2-dev libxslt1-dev libreadline5 LIBG Dbm-dev libgdb-dev libxml2 libssl-dev tk-dev libgdbm-dev libexpat1-dev Libncursesw5-dev

Start installing Pythonbrew

Use the recommended method to install the website:

CURL-KL Http://xrl.us/pythonbrewinstall | Bash

The above command automatically installs the Pythonbrew in the ~/.pythonbrew directory.

Third, the use of pythonbrew

1. View the version of Python that can be installed

$ pythonbrew List--know

2, install the required Python version, need to install the Curl tool, installation will be completed automatically;

$ pythonbrew Install 3.3.1

3. View the version of Python that is already installed, followed by an * sign for the version that is in use

$ pythonbrew List

4. Select a Python version to use, only valid at the current terminal

$ pythonbrew Use 3.3.1

5, select the python3.3.1 version as the default version of the system (user) to use, will add the path of the version to the path

$ pythonbrew Switch 3.3.1---------------------------------------------------------------------------------------- ---------------------------------------------Note: After installing pythonbrew as described above, execute the command: pythonbrew switch 3.3.1 Unexpectedly cannot switch to the specified Python version correctly, and later discovered that the reason is: after the installation of Pythonbrew is complete, be sure to write the following in the. bashrc file:
[-S "$HOME/.PYTHONBREW/ETC/BASHRC"]] && source "$HOME/.PYTHONBREW/ETC/BASHRC"
and execute: source. BASHRC
This will allow you to switch to the specified version of Python normally.
--------------------------------------------------------------------------------------------------------------- ----------------------

6. Cancel Pythonbrew selected version

$ pythonbrew Off

7, clean the installed version of the source code and installation package

$ pythonbrew Cleanup

8. Specify the Python version to run the file

$ pythonbrew py-p 3.3.1 test.py

9. Delete the Python version

$ pythonbrew Uninstall 3.3.1

Ubuntu 10.10 Installation and use Pythonbrew Introduction

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: [email protected] 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.