Changes between Version 22 and Version 23 of PythonGuidelines


Ignore:
Timestamp:
Jul 3, 2013 8:49:41 AM (8 years ago)
Author:
Sergio Correia
Comment:

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

Legend:

Unmodified
Added
Removed
Modified
  • PythonGuidelines

    v22 v23  
    106106python_select -l
    107107}}}
     108
     109== Building the Efl/Gtk port in a distro which uses Python 3.x as default ==
     110
     111If you use a distro which has Python 3 as the default python for the system - such as [http://www.archlinux.org 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 [http://www.virtualenv.org/ virtualenv], which allows you to create virtual environments that may use different versions of python.
     113
     114In ArchLinux, you would install virtualenv with the following command:
     115{{{
     116# pacman -S python2-virtualenv
     117}}}
     118
     119[The next instructions are not distro-specific.]
     120
     121After installing virtualenv, create the place where the virtual environment will live:
     122{{{
     123$ mkdir -p ~/.virtualenvs/webkit
     124}}}
     125
     126And create the actual virtual environment:
     127{{{
     128$ virtualenv2 ~/.virtualenvs/webkit
     129}}}
     130
     131Now that the virtual environment exists, you will basically activate it before working on WebKit and once you are done, you can deactivate it.
     132
     133To activate the virtual environment:
     134{{{
     135$ source ~/.virtualenvs/webkit/bin/activate
     136}}}
     137
     138Now your default python is Python 2, which allows you to use JHBuild and build WebKit without hassle.
     139
     140When you are done, simply deactivate the virtual environment:
     141{{{
     142$ deactivate
     143}}}
     144
     145And you are back to your distro's default python.