From 44244816844ef819dbd6ce6ac66eb6260a23aac9 Mon Sep 17 00:00:00 2001 From: Dan Yeaw Date: Tue, 6 Mar 2018 22:37:53 -0500 Subject: Add detailed development environment setup instructions Signed-off-by: Dan Yeaw --- docs/getting_started.rst | 80 +++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 45 deletions(-) (limited to 'docs/getting_started.rst') diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 030af55e..fe2a6a44 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -22,15 +22,8 @@ the following content and save it somewhere: window.connect("destroy", Gtk.main_quit) Gtk.main() - -.. _pypi: - -|python-logo| From PyPI ------------------------ -Before we can run the example application we need to install PyGObject, GTK+ and -their dependencies. Although not strictly required, the recommend way to run -PyGObject is from within a virtual environment and using pip. Follow the -instructions for your platform below. +Before we can run the example application we need to install PyGObject, GTK+ +and their dependencies. Follow the instructions for your platform below. ======================================= ==================================== ==================================== ========================================== |ubuntu-logo| :ref:`Ubuntu ` |fedora-logo| :ref:`Fedora ` |arch-logo| :ref:`Arch Linux ` |opensuse-logo| :ref:`openSUSE ` @@ -46,7 +39,7 @@ instructions for your platform below. 1) Go to http://www.msys2.org/ and download the x86_64 installer 2) Follow the instructions on the page for setting up the basic environment 3) Run ``C:\msys64\mingw32.exe`` - a terminal window should pop up -4) Execute ``pacman -S mingw-w64-i686-gtk3 mingw-w64-i686-python2-gobject mingw-w64-i686-python3-gobject mingw-w64-i686-gobject-introspection`` +4) Execute ``pacman -S mingw-w64-i686-gtk3 mingw-w64-i686-python2-gobject mingw-w64-i686-python3-gobject`` 5) To test that GTK+3 is working you can run ``gtk3-demo`` 6) Copy the ``hello.py`` script you created to ``C:\msys64\home\`` 7) In the mingw32 terminal execute ``python3 hello.py`` - a window should appear. @@ -61,13 +54,9 @@ instructions for your platform below. ------------------------------------------- 1) Open a terminal -2) Execute ``sudo apt install python-gi python-gi-cairo python3-gi python3-gi-cairo gir1.2-gtk-3.0 libgirepository1.0-dev`` -3) Execute ``virtualenv --python=python3 myvenv`` -4) Execute ``source myvenv/bin/activate`` -5) Execute ``pip install pycairo`` -6) Execute ``pip install pygobject`` -7) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``) -8) Run ``python3 hello.py`` +2) Execute ``sudo apt install python-gi python-gi-cairo python3-gi python3-gi-cairo gir1.2-gtk-3.0`` +3) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``) +4) Run ``python3 hello.py`` .. figure:: images/start_linux.png :scale: 60% @@ -79,13 +68,9 @@ instructions for your platform below. -------------------- 1) Open a terminal -2) Execute ``sudo dnf install pygobject3 python3-gobject gtk3 gobject-introspection-devel python3-cairo-devel cairo-gobject-devel`` -3) Execute ``virtualenv --python=python3 myvenv`` -4) Execute ``source myvenv/bin/activate`` -5) Execute ``pip install pycairo`` -6) Execute ``pip install pygobject`` -7) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``) -8) Run ``python3 hello.py`` +2) Execute ``sudo dnf install pygobject3 python3-gobject gtk3`` +3) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``) +4) Run ``python3 hello.py`` .. _arch: @@ -94,13 +79,9 @@ instructions for your platform below. ---------------------- 1) Open a terminal -2) Execute ``sudo pacman -S python-gobject python2-gobject gtk3 gobject-introspection`` -3) Execute ``virtualenv --python=python3 myvenv`` -4) Execute ``source myvenv/bin/activate`` -5) Execute ``pip install pycairo`` -6) Execute ``pip install pygobject`` -7) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``) -8) Run ``python3 hello.py`` +2) Execute ``sudo pacman -S python-gobject python2-gobject gtk3`` +3) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``) +4) Run ``python3 hello.py`` .. _opensuse: @@ -109,13 +90,9 @@ instructions for your platform below. ------------------------ 1) Open a terminal -2) Execute ``sudo zypper install python-gobject python3-gobject gtk3 gobject-introspection python3-cairo-devel cairo-gobject-devel`` -3) Execute ``virtualenv --python=python3 myvenv`` -4) Execute ``source myvenv/bin/activate`` -5) Execute ``pip install pycairo`` -6) Execute ``pip install pygobject`` -7) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``) -8) Run ``python3 hello.py`` +2) Execute ``sudo zypper install python-gobject python3-gobject gtk3`` +3) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``) +4) Run ``python3 hello.py`` .. _macosx: @@ -126,13 +103,26 @@ instructions for your platform below. 1) Go to https://brew.sh/ and install homebrew 2) Open a terminal 3) Execute ``brew install pygobject3 --with-python3 gtk+3`` to install for both python2 and python3 -4) Execute ``brew install gobject-introspection`` -5) Execute ``virtualenv --python=python3 myvenv`` -6) Execute ``source myvenv/bin/activate`` -7) Execute ``pip install pycairo`` -8) Execute ``pip install pygobject`` -9) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``) -10) Run ``python3 hello.py`` +4) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``) +5) Run ``python3 hello.py`` .. figure:: images/start_macos.png :scale: 70% + + +.. _pypi: + +|python-logo| From PyPI +----------------------- + +PyGObject is also available on PyPI: https://pypi.org/project/PyGObject + +For this approach you have to make sure that all runtime and build +dependencies are present yourself as pip will only take care of pycairo. + +.. code:: + + virtualenv --python=python3 myvenv + source myvenv/bin/activate + pip install pygobject + python hello.py -- cgit v1.2.1