Skip to content

Installing Python

Eoin Elliott edited this page Jul 30, 2020 · 17 revisions

python can be installed in a number of ways, but the simplest one which leads to the fewest possible errors is using Anaconda - Download Page. It will install a lot of useful modules, as well as spyder, and extras. You can also use miniconda to save space by only installing what you want, but this is guide will only focus on anaconda.

Proceed with installation using default setting, select an install for “Just Me" (all users will also work)img Make sure to check the "add Anaconda3 to my path environment variable" as it normally is unchecked, and finish the installation.

Either using a command prompt or an Anaconda prompt, you'll now need to install a couple of packages. I recommend using conda for all package installation, however if you only use pip this will also work.
type conda install spyder.

You'll want to add nplab as a local package. To do this, first clone the nplab respository here (click code - open with github desktop client) (You'll need github desktop - link). Open Spyder by typing spyder in the command prompt. Go to tools>PYTHONPATH manager. Add the path to Documents/GitHub/nplab, and click synchronize. Check that this worked by restarting the open python console and typing import nplab.

Using the data browser

First, try opening a data browser through spyder. Install pyqtgraph via conda. In the spyder console type:

from nplab.datafile import current
current().show_gui()

If this works, then you can try right clicking a .H5 file (you just created one with the above) and choosing open with... and navigate to nplab/ui/open_browser_cmd.bat. If this doesn't work, you'll need to edit the system path environment variable to have the anaconda paths first. This can be done by following the images here.

Other packages

Any other packages you may need can be installed in the same way, do so when you encounter an ImportError: X not found. If conda cannot find the package, google the package name + conda to find a a page like https://anaconda.org/anaconda/numpy, and use the command line given at the bottom.

Clone this wiki locally