Changes between Version 9 and Version 10 of Python3Support
- Timestamp:
- 09/03/18 11:41:05 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Python3Support
v9 v10 638 638 cmp 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. 639 639 640 == How to test 641 We can create isolated environment with Python 3 for example using virtualenv: 642 {{{ 640 == How to test == 641 642 We 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 644 Installation of virtualenv-3: 645 {{{ 646 # 1) generic, using pip (WHICH SYSTEM?) 643 647 pip install virtualenv 648 649 # 2) on Fedora 650 sudo dnf install python3-virtualenv gtk3-devel gstreamer-devel gstreamer-plugins-base-devel 651 652 # 3) on Debian 653 apt-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 660 Preparation of the virtual Python3 environment: 661 {{{ 644 662 # create environment 663 664 # 1) on Ubuntu 645 665 virtualenv -p python3 grasspy3 646 # activate it 666 # 2) on Fedora 667 virtualenv-3 -p python3 grasspy3 668 }}} 669 670 Activating the virtual Python3 environment for testing: 671 {{{ 672 # activate it (this will change the terminal prompt so that you know where you are...) 647 673 source grasspy3/bin/activate 648 # install python packages GRASS needs 674 675 # now, within this environment 676 # install required Python3 packages for GRASS GIS 649 677 pip install wxpython 650 678 pip install numpy 651 # test GRASS and then deactivate the environment 679 }}} 680 681 We are now settled with the dependencies. 682 683 Test GRASS GIS with Python3: 684 {{{ 685 # just run it in the virtualenv-3 session 686 grass76 --gui 687 }}} 688 689 In order to deactivate the virtualenv-3 environment, run 690 {{{ 652 691 deactivate 653 692 }}}