pyenv-register is a pyenv plugin to use system installed Python.
Installing versions of python with pyenv install
takes a longer time
than using system package management tools (like apt-get, yum).
pyenv-register
imports system-installed python to pyenv environment.
It works by creating a virtual environment for that installation and
pointing pyenv
to it.
$ git clone https://github.com/garyp/pyenv-register.git $(pyenv root)/plugins/pyenv-register
$ exec "$SHELL"
$ sudo apt-get install -y python3.3 # install by package management system
$ /usr/bin/python3.3 --version
Python 3.3.2+
$ pyenv register /usr/bin/python3.3
$ pyenv versions
* system (set by /home/xxxx/.pyenv/version)
system-3.3.2
An environment named system-x.x.x
will be created.
The environment contains system-installed libraries.
$ sudo apt-get install -y python3-lxml
$ pyenv register /usr/bin/python3.3
$ pyenv shell system-3.3.2
$ pip freeze | grep lxml
lxml==3.2.0