Changes between Version 9 and Version 10 of Python3Support


Ignore:
Timestamp:
09/03/18 11:41:05 (6 years ago)
Author:
neteler
Comment:

be less cryptic for newbies

Legend:

Unmodified
Added
Removed
Modified
  • Python3Support

    v9 v10  
    638638cmp function is not available in Python3, it has been custom created and included in gui/wxpython/core/utils.py file. Be sure to include it where cmp() is used.
    639639
    640 == How to test
    641 We can create isolated environment with Python 3 for example using virtualenv:
    642 {{{
     640== How to test ==
     641
     642We can rather easily create an isolated environment with Python3 using virtualenv which lets you test GRASS GIS with Python3 support while not cluttering your standard system.
     643
     644Installation of virtualenv-3:
     645{{{
     646# 1) generic, using pip (WHICH SYSTEM?)
    643647pip install virtualenv
     648
     649# 2) on Fedora
     650sudo dnf install python3-virtualenv gtk3-devel gstreamer-devel gstreamer-plugins-base-devel
     651
     652# 3) on Debian
     653apt-get install -y libgtk2.0-dev libgtk-3-dev \
     654        libjpeg-dev libtiff-dev \
     655        libsdl1.2-dev libgstreamer-plugins-base0.10-dev \
     656        libnotify-dev freeglut3 freeglut3-dev libsm-dev \
     657        libwebkitgtk-dev libwebkitgtk-3.0-dev
     658}}}
     659
     660Preparation of the virtual Python3 environment:
     661{{{
    644662# create environment
     663
     664# 1) on Ubuntu
    645665virtualenv -p python3 grasspy3
    646 # activate it
     666# 2) on Fedora
     667virtualenv-3 -p python3 grasspy3
     668}}}
     669
     670Activating the virtual Python3 environment for testing:
     671{{{
     672# activate it (this will change the terminal prompt so that you know where you are...)
    647673source grasspy3/bin/activate
    648 # install python packages GRASS needs
     674
     675# now, within this environment
     676# install required Python3 packages for GRASS GIS
    649677pip install wxpython
    650678pip install numpy
    651 # test GRASS and then deactivate the environment
     679}}}
     680
     681We are now settled with the dependencies.
     682
     683Test GRASS GIS with Python3:
     684{{{
     685# just run it in the virtualenv-3 session
     686grass76 --gui
     687}}}
     688
     689In order to deactivate the virtualenv-3 environment, run
     690{{{
    652691deactivate
    653692}}}