• Stars
    star
    749
  • Rank 58,376 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created about 12 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python installation manager supporting CPython, Stackless, PyPy and Jython

pythonz: a Python installation manager

Overview

pythonz is a program to automate the building and installation of Python versions in the user's $HOME. This is a fork of the original project, pythonbrew.

The original project seems to be unmaintained, and it also has some extra features which I don't really need, so I made this fork to make something a bit simpler that works for me. You may also find it useful.

CPython, Stackless, PyPy and Jython are supported.

Installation

The recommended way to download and install pythonz is to run these statements in your shell:

curl -kL https://raw.github.com/saghul/pythonz/master/pythonz-install | bash

or:

fetch -o - https://raw.github.com/saghul/pythonz/master/pythonz-install | bash

After that, pythonz installs itself to ~/.pythonz.

Please add the following line to the end of your ~/.bashrc:

[[ -s $HOME/.pythonz/etc/bashrc ]] && source $HOME/.pythonz/etc/bashrc

If you need to install pythonz into somewhere else, you can do that by setting a PYTHONZ_ROOT environment variable:

export PYTHONZ_ROOT=/path/to/pythonz
curl -kLO https://raw.github.com/saghul/pythonz/master/pythonz-install
chmod +x pythonz-install
./pythonz-install

For Systemwide (Multi-User) installation

If the install script is run as root, pythonz will automatically install into /usr/local/pythonz.

pythonz will be automatically configured for every user on the system if you install it as root.

After installing it, where you would normally use sudo, non-root users will need to use sudo-pythonz:

sudo-pythonz install 3.8.0

Before installing Python versions via pythonz

You might want to install some optional dependencies, for functionality that is often expected to be included in a Python build (it can be a bummer to discover these missing and have to rebuild your Python setup). These include the following, ordered by (very roughly guessed) probability that you will need them:

Debian family (Ubuntu...)

sudo apt-get install build-essential zlib1g-dev libbz2-dev libssl-dev libreadline-dev libncurses5-dev libsqlite3-dev libgdbm-dev libdb-dev libexpat-dev libpcap-dev liblzma-dev libpcre3-dev libffi-dev

If you need tkinter support, add tk-dev.

RPM family (CentOS, RHEL...)

yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel readline-devel ncurses-devel sqlite-devel gdbm-devel db4-devel expat-devel libpcap-devel xz-devel pcre-devel libffi-devel

If you need tkinter support, add tk-devel.

macOS

Apple stopped including the OpenSSL development headers in OS X El Captian and macOS Sierra. You will need to install OpenSSL with Homebrew (or MacPorts). This document assumes usage of Homebrew.

xcode-select --install
brew install openssl

You should then add variables for CPPFLAGS and LDFLAGS to your shell environment. This allows pythonz to find the OpenSSL installed by Homebrew.

export CPPFLAGS="-I/usr/local/opt/openssl/include"
export LDFLAGS="-L/usr/local/opt/openssl/lib"

Usage

pythonz command [options] version

See the available commands

pythonz help

To get help on each individual command

pythonz help <command>

Install some Python versions

pythonz install 2.7.3
pythonz install -t stackless 2.7.2
pythonz install -t jython 2.5.2
pythonz install -t pypy --url https://bitbucket.org/pypy/pypy/downloads/pypy-1.8-osx64.tar.bz2 1.8
pythonz install --verbose 2.7.2
pythonz install --configure="CC=gcc_4.1" 2.7.2
pythonz install --url http://www.python.org/ftp/python/2.7/Python-2.7.2.tgz 2.7.2
pythonz install --file /path/to/Python-2.7.2.tgz 2.7.2
pythonz install 2.7.3 3.2.3
pythonz install -t pypy3 2.3.1

List the installed Python versions

pythonz list

List all the available Python versions for installing

pythonz list -a

List all the available Jython versions

pythonz list -a -t jython

Uninstall the specified Python

pythonz uninstall 2.7.3
pythonz uninstall -t stackless 3.2.2

Remove stale source folders and archives

pythonz cleanup

Upgrade pythonz to the latest version

pythonz update

Check the installed pythonz version

pythonz version

Print the path to the interpreter of a given version

pythonz locate 2.7.7

Recommended way to use a pythonz-installed version of Python

For Python <= 3.2

Use virtualenv, e.g.:

mkvirtualenv -p $(pythonz locate 2.7.3) python2.7.3

For more information about virtualenv, check out the virtualenv documentation.

For Python >= 3.3

Use venv directly from Python, e.g.:

/usr/local/pythonz/pythons/CPython-3.4.1/bin/python3 -m venv python3.4.1

For more information about venv, check out the venv documentation.

DTrace support

CPython versions 2.7.6 and 3.3.4 can be built with DTrace suport. Patches adding support for DTrace have been taken from this page by Jesús Cea.

Building Python with DTrace support:

pythonz install --configure="--with-dtrace" 2.7.6

More Repositories

1

txiki.js

A tiny JavaScript runtime
C
2,343
star
2

pyuv

Python interface for libuv
C
1,112
star
3

aiodns

Simple DNS resolver for asyncio
Python
514
star
4

sipp-scenarios

SIPp scenarios I use for testing SIP stuff
256
star
5

lxd-alpine-builder

Build Alpine Linux images for LXD
Shell
168
star
6

python-fibers

Lightweight cooperative microthreads for Python
C
160
star
7

pycares

Python interface for c-ares
Python
157
star
8

uvent

A gevent core implemented using libuv
Python
136
star
9

wasi-lab

Some WASI experiments 🧪☣️☠️
C
116
star
10

evergreen

Cooperative multitasking and i/o for Python
Python
114
star
11

CallRoulette

A WebRTC demo using Python (asyncio + aiohttp) as the backend
JavaScript
103
star
12

sjs

Skookum JS: a JavaScript runtime
C
97
star
13

tornaduv

Tornado IOLoop implemented with pyuv
Python
96
star
14

aiouv

A PEP-3156 compatible event loop
Python
71
star
15

uvwsgi

Python WSGI server
Python
37
star
16

qrfcview-osx

RFC viewer for OSX
C++
36
star
17

node-abstractsocket

Abstract namespace socket support for Node
JavaScript
24
star
18

libuv-chat

Something something libuv something
C
21
star
19

twisted-pyuv

Twisted reactor implemented with pyuv
Python
19
star
20

njk

Powerful portable templating in less than 1MB
C
19
star
21

cordova-plugin-audioroute

iOS audio route change events and more for Cordova
Objective-C
17
star
22

twitterbot

A simple Twitter bot retwitting the given hashtag
Python
14
star
23

TunnelIt

SSH reverse forwarder using Twisted
Python
14
star
24

sipsimple-examples

SIPSIMPLE SDK examples
Python
13
star
25

macOS-setup

My macOS setup, automated with Ansible
Shell
11
star
26

dotvim

My vim configuration
Vim Script
11
star
27

SIPwPing-server

Server providing a simple RESTful API to ping SIP servers
Python
11
star
28

shline

A simple powerline style prompt for my bash shell
Python
10
star
29

tornado-backdoor

Interactive Python interpreter over TCP for Tornado applications
Python
9
star
30

pysophia

WIP: Python (CFFI) bindings for Sophia
Python
9
star
31

jitsi-meet-api

Jitsi Meet external API wrapper
JavaScript
8
star
32

sandbox-html

JavaScript
7
star
33

gyn

Generate You some Ninja
Python
6
star
34

uttp

[Unfinished] libuv based HTTP server
C
6
star
35

dotfiles

My dotfiles
Shell
6
star
36

sylk-in-a-box

SylkServer + Sylk WebRTC client, in a box
Nginx
5
star
37

vim-colortoggle

A ViM plugin for toggling background and color scheme
Vim Script
5
star
38

yass

Yet Another SIP Softphone (archive)
Python
3
star
39

python-imap-prowl

A python script to sendpush notifications when new emails via Prowl push service
3
star
40

evergreen-requests

Evergreen + Requests
Python
3
star
41

notes

Notes about anything and everything
Python
2
star
42

jcfg

Jinja templates for your configuration files
Python
2
star
43

sipstache

The Ultimate Virtual Moustache Toolkit (TM)
Python
2
star
44

python-wsserver

[DEAD] A simple, single threaded WebSocket server
Python
2
star
45

python-asiri

GPIO interface for Asiri board with a MCP230XX chip
Python
1
star
46

python-imaplib2

Python threaded IMAP4 client module by Piers Lauder
Python
1
star
47

gvoice-sip-status

Google App Engine application to query the availability of Google Voice inbound SIP service
Python
1
star
48

docker-nginx-webdav

Docker image using nginx to serve files over WebDAV
1
star
49

sipwping-django

Web frontend for SIPwPing server, based on Django
JavaScript
1
star