Changes between Version 22 and Version 23 of PythonGuidelines

Jul 3, 2013 8:49:41 AM (10 years ago)
Sergio Correia

Added section on how to work with distros that come with Python 3 as default - it is problematic with JHBuid, used by the Efl/Gtk ports


  • PythonGuidelines

    v22 v23  
    106106python_select -l
     109== Building the Efl/Gtk port in a distro which uses Python 3.x as default ==
     111If you use a distro which has Python 3 as the default python for the system - such as [ ArchLinux] -, you will have problems during the step that uses JHBuild to manage the dependencies of Efl and Gtk ports, since it requires Python 2.
     112A solution to enable you to work properly with these ports in such distros would be to install [ virtualenv], which allows you to create virtual environments that may use different versions of python.
     114In ArchLinux, you would install virtualenv with the following command:
     116# pacman -S python2-virtualenv
     119[The next instructions are not distro-specific.]
     121After installing virtualenv, create the place where the virtual environment will live:
     123$ mkdir -p ~/.virtualenvs/webkit
     126And create the actual virtual environment:
     128$ virtualenv2 ~/.virtualenvs/webkit
     131Now that the virtual environment exists, you will basically activate it before working on WebKit and once you are done, you can deactivate it.
     133To activate the virtual environment:
     135$ source ~/.virtualenvs/webkit/bin/activate
     138Now your default python is Python 2, which allows you to use JHBuild and build WebKit without hassle.
     140When you are done, simply deactivate the virtual environment:
     142$ deactivate
     145And you are back to your distro's default python.