diff options
Diffstat (limited to 'doc/source/virtualenv.rst')
-rw-r--r-- | doc/source/virtualenv.rst | 97 |
1 files changed, 19 insertions, 78 deletions
diff --git a/doc/source/virtualenv.rst b/doc/source/virtualenv.rst index 3d86617..ccdd9b6 100644 --- a/doc/source/virtualenv.rst +++ b/doc/source/virtualenv.rst @@ -12,30 +12,12 @@ Prerequisites This guide assumes that your system meets the following requirements: - - a version of python compatible with *silx* is installed (python 2.7 or python >= 3.5) + - a version of python compatible with *silx* is installed (Python >= 3.5) - the *pip* installer for python packages is installed - - the Qt and PyQt libraries are installed (optional, required for using ``silx.gui``) Installation procedure ---------------------- - -Install vitrualenv -****************** - -.. code-block:: bash - - pip install virtualenv --user - -.. note:: - - This step is not required for recent version of Python 3. - Virtual environments are created using a builtin standard library, - ``venv``. - On Debian platforms, you might need to install the ``python3-venv`` - package. - - Create a virtualenv ******************* @@ -51,20 +33,12 @@ a virtual environment named ``silx_venv`` cd mkdir -p venvs cd venvs - virtualenv silx_venv - + python -m venv silx_venv A virtualenv contains a copy of your default python interpreter with a few tools to install packages (pip, setuptools). -To use a different python interpreter, you can specify it on the command line. -For example, to use python 3.4: - -.. code-block:: bash - - virtualenv -p /usr/bin/python3.4 silx_venv - -But for python 3 you should use the builtin ``venv`` module: +Virtual environments are created using a builtin standard library, ``venv`` (Python3 only): .. code-block:: bash @@ -72,11 +46,20 @@ But for python 3 you should use the builtin ``venv`` module: .. note:: + On Debian platforms, you might need to install the ``python3-venv`` package. + If you don't need to start with a clean environment and you don't want to install each required library one by one, you can use a command line option to create a virtualenv with access to all system packages: ``--system-site-packages`` +To use a different python interpreter, use it to create the virtual environment. +For example, to use python 3.5: + +.. code-block:: bash + + /usr/bin/python3.5 -m venv silx_venv + Activate a virtualenv ********************* @@ -128,64 +111,28 @@ install *silx*: .. since 0.5, numpy is now automatically installed when doing `pip install silx` -Install optional dependencies -***************************** - -The following command installs libraries that are needed by various modules -of *silx*: - -.. code-block:: bash - - pip install matplotlib fabio h5py - -The next command installs libraries that are used by the python modules -handling parallel computing: - -.. code-block:: bash - - pip install pyopencl mako - - -Install pyqt +Install silx ************ -If your python version is 3.5 or newer, installing PyQt5 and all required packages -is as simple as typing: - -.. code-block:: bash - - pip install PyQt5 - -For previous versions of python, there are no PyQt wheels available, so the installation -is not as simple. - -The simplest way, assuming that PyQt is installed on your system, is to use that -system package directly. For this, you need to add a symbolic link to your virtualenv. - -If you want to use PyQt5 installed in ``/usr/lib/python2.7/dist-packages/``, type: +To install silx with minimal dependencies, run: .. code-block:: bash - ln -s /usr/lib/python2.7/dist-packages/PyQt5 silx_venv/lib/python2.7/site-packages/ - ln -s /usr/lib/python2.7/dist-packages/sip.so silx_venv/lib/python2.7/site-packages/ - + pip install silx -Install silx -************ +To install silx with all dependencies, run: .. code-block:: bash - pip install silx - + pip install silx[full] -To test *silx*, open an interactive python console. If you managed to install PyQt5 or PySide2 -in your virtualenv, type: +To test *silx*, open an interactive python console: .. code-block:: bash python -If you don't have PyQt, use: +If you don't have PyQt5 or PySide2, run: .. code-block:: bash @@ -195,9 +142,3 @@ Run the test suite using: >>> import silx.test >>> silx.test.run_tests() - - - - - - |