FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

How to use pyenv to manage multiple Python versions on Ubuntu/Mac · Issue #249 · cztomczak/cefpython · GitHub

Repository navigation

How to use pyenv to manage multiple Python versions on Ubuntu/Mac #249

Closed

Description

Tested with Ubuntu 14.04 and Mac 10.9.

pyenv: https://github.com/yyuu/pyenv

Install on Linux: https://github.com/yyuu/pyenv-installer

Don't forget dependencies on Linux: https://github.com/pyenv/pyenv/wiki/common-build-problems

Install on Mac with Homebrew: https://github.com/yyuu/pyenv#homebrew-on-mac-os-x

Add pyenv to ~/.bashrc . Do not add the eval "$(pyenv virtualenv-init -)" line otherwise pyenv is broken then.

.bashrc for Linux:

export PYTHON_CONFIGURE_OPTS="--enable-shared"
export PATH="/home/cz/.pyenv/bin:$PATH"
eval "$(pyenv init -)"

.bash_profile for Mac:

export PYTHON_CONFIGURE_OPTS="--enable-framework"
export PATH="/usr/local/bin:/usr/local/git/bin:$PATH"
eval "$(pyenv init -)"

Python must be built as shared library on Linux and as framework on Mac

Python must be built as shared library on Linux, and as framework on Mac. See this explanation by Robin Dunn: wxWidgets/Phoenix#288 (comment)

Build options explained on pyenv wiki page:
https://github.com/pyenv/pyenv/wiki#how-to-build-cpython-with-framework-support-on-os-x
https://github.com/pyenv/pyenv/wiki#how-to-build-cpython-with---enable-shared

Continued

Install multiple Pythons. Before proceeding install required packages listed here: https://github.com/yyuu/pyenv/wiki/Common-build-problems

pyenv install --list
pyenv install 3.4.5
pyenv install 3.5.2

Change Python version in current terminal (shell), in current directory (local, creates .python-local file) or globally (global):

pyenv shell 3.4.5
pyenv local 3.4.5
pyenv global 3.4.5  <-- using global is recommended

Issue with sudo

It doesn't work with sudo. But it shouldn't matter, because when installing python package you don't need to use sudo, as Python is installed in ~/.pyenv and doesn't require root privileges.

Update pyenv

You need to update pyenv so that you can install new Python versions available. When executing pyenv install --list I didn't see latest Py 3.6 rc1. I had to run pyenv update to be able to install it.

Homebrew

Mac notes for Homebrew:

  • Install GUI toolkits for the Homebrew Python: brew install python, brew install wxpython, brew install pygtk, brew install gtk+3 pygobject3, etc.
  • To install GUI toolkits for Homebrew's Python 3 type: brew install python3, brew install gtk+3 pygobject3 --with-python3.
  • To install PySide for Qt4 type: install Qt 4.8.5 dmg and type sudo pip install pyside==1.2.2. If there are errors when importing library add pyside directory to DYLD_LIBRARY_PATH or run the pyside postinstall script manually (find it on the web).

Activity

  1. changed the title [-]Using pyenv to manage multiple Python versions on Ubuntu[/-] [+]How to use pyenv to manage multiple Python versions on Ubuntu[/+] on Sep 17, 2016
  2. changed the title [-]How to use pyenv to manage multiple Python versions on Ubuntu[/-] [+]How to use pyenv to manage multiple Python versions on Ubuntu/Mac[/+] on Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL