PyMoDAQ is written in Python and uses Python 3.5+. It uses the PyQt5 library and the excellent pyqtgraph package for its user interface. For PyMoDAQ 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.2. Setting up a new environment¶
- Download and install Miniconda3.
- Open a console, and cd to the location of the condabin folder, for instance:
- Create a new environment:
conda create -n my_env python=3.7, where my_env is your new environment name, could be pymodaq16 if you plan to install PyMoDAQ version 1.6.0 for instance.. This will create the environment with python version 3.7 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
- Install, using conda manager, some mandatory packages:
conda install pyqt
2.3. Installing PyMoDAQ¶
Easiest part: in your newly created and activated environment enter:
pip install pymodaq. This will install the
latest PyMoDAQ available version and all its dependencies. For a specific version enter:
pip install pymodaq==x.y.z.
2.4. Creating shortcuts on Windows¶
Python packages can easily be started from the command line (see How to Start). 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:
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.dashboard. 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 file (here dashboard.py, starting the Dashboard module, python -m pymodaq.dashboard bit)
Do it again for each PyMoDAQ’s module you want (to get the correct python file and it’s path, see From command line tool:).
2.5. Plugin Manager¶
The complete list of available plugins is maintained on this GitHub repository.
While you can install them manually (for instance using
pip install plugin_name), from PyMoDAQ 2.2.2 a plugin
manager is available. You can open it from the Dashboard in the help section or directly using the command
python -m pymodaq_plugin_manager.manager or directly
This will open the Plugin Manager User Interface as shown on figure Fig. 2.3 listing the available plugins packages that can be either installed, updated or removed. It includes a description of the content of each package and the instruments it interfaces. For instance, on figure Fig. 2.3, the selected Andor plugin package is selected and includes two plugins: a Viewer1D to interface Andor Shamrock spectrometers and a Viewer2D to interface Andor CCD camera.
2.6. What about the Hardware¶
So far, you’ve installed all the software layer managing Instrument control from the user up to the manufacturer driver. This means you still have to install properly your specific hardware. For this, there is no general recipe but below you’ll find some advices/steps you can follow.
2.6.1. Serial/GPIB based hardware¶
In the case where your instrument is controlled using ASCII commands (basically strings), no more steps than plugging you instrument is needed. Just make sur the COM port or GPIB address is correct.
2.6.2. Library based hardware¶
In the case of instruments using a specific manufacturer driver (.dll, .so or .NET libraries) then you could follow these steps:
- Install the SDK/dll driver from the manufacturer
- Test the communication is fine using the software provided by the manufacturer (if available)
- Make sure your OS (Windows, Mac or linux) is able to find the installed library (if needed add the path pointing to your library in the PATH environment variable of your operating system
- Install the right PyMoDAQ’s plugin
- You should be good to go!
Example: if you want to use a NI-DAQ instrument. You’ll have to first install their driver Ni-DAQmx, then test you hardware using their MAX software and finally configure it using pymodaq_plugins_daqmx plugin.