2. Installation

For PyMoDAQ-Femto to run smoothly, you need a Python distribution to be installed. Here are some advices. On all platforms Windows, MacOS or Linux, Anaconda or Miniconda is the advised distribution/package manager. Environments can be created to deal with different version of packages and isolate the code from other programs. Anaconda comes with a full set of installed scientific python packages while Miniconda is a very light package manager.

2.1. Setting up a new environment

  • Download and install Miniconda3.

  • Open a console, and cd to the location of the condabin folder, for instance: C:\Miniconda3\condabin

  • Create a new environment: conda create -n my_env python=3.8, where my_env is your new environment name. This will create the environment with python version 3.8 that is currently the recommended one.

  • Activate your environment so that only packages installed within this environment will be seen by Python: conda activate my_env

2.2. Installing PyMoDAQ-Femto

Easiest part: in your newly created and activated environment enter: pip install pymodaq_femto. This will install the latest PyMoDAQ-Femto available version and all its dependencies. For a specific version enter: pip install pymodaq_femto==x.y.z.

2.3. Launching PyMoDAQ-Femto

During its installation, two scripts have been installed within you environment directory, this means you can start PyMoDAQ-Femto’s two main functionalities directly writing in your console either:

  • simulator

  • retriever

Alternatively, you can specify the full commands (The -m option tells python to look within its site-packages folder, where you’ve just installed pymodaq_femto):

  • python -m pymodaq_femto.simulator

  • python -m pymodaq_femto.retriever

2.4. Creating shortcuts on Windows

Python packages can easily be started from the command line (see Launching PyMoDAQ-Femto). However, Windows users will probably prefer using shortcuts on the desktop. Here is how to do it (Thanks to Christophe Halgand for the procedure):

  • First create a shortcut (see Fig. 2.1) on your desktop (pointing to any file or program, it doesn’t matter)

  • Right click on it and open its properties (see Fig. 2.2)

  • On the Start in field (“Démarrer dans” in french and in the figure), enter the path to the condabin folder of your miniconda or anaconda distribution, for instance: C:\Miniconda3\condabin

  • On the Target field, (“Cible” in french and in the figure), enter this string: C:\Windows\System32\cmd.exe /k conda activate my_env & python -m pymodaq_femto.retriever. This means that your shortcut will open the windows’s command line, then execute your environment activation (conda activate my_env bit), then finally execute and start Python, opening the correct pymodaq_femto file (here retriever.py, starting the Retriever module, python -m pymodaq_femto.retriever bit)

  • You’re done!

  • Do it again for each PyMoDAQ-Femto’s module you want (to get the correct python file and it’s path, see Launching PyMoDAQ-Femto).

shortcut

Fig. 2.1 Create a shortcut on your desktop

shortcut properties

Fig. 2.2 Shortcut properties