Skip to content

NEURON and Python Setup

Joey Kilgore edited this page Oct 7, 2019 · 2 revisions

Setup

The following setup process is for Python developers. If you do not plan on using python, and just plan on writing HOC and running simulations through the gui, then all you need is NEURON, and you should use Visual Studio Code as your IDE

Resources :

Download Neuron : https://neuron.yale.edu/neuron/download

Download Anaconda : https://www.anaconda.com/download/ Python 3 Version

Video Tutorial : https://www.youtube.com/watch?v=jWjiPWG3DKY++++

Download Visual Studio Code : https://code.visualstudio.com/download

  1. Download Neuron
  1. Goto the link above
  2. Download and launch installer
  3. Check 'Set DOS environment.' and leave all other checkboxes as default
  4. Click Install
  5. Optional check install
  1. Goto File explorer
  2. navigate to C:nrndemo
  3. Open demo.hoc (it's a NEURON model file)
  4. The Neuron GUI will launch and there are sample simulations you can run
  1. Download Anaconda
  1. Goto the link above
  2. Download Anaconda, Python 3 Version
  3. Launch installer
  4. Go through installer, select all defaults
  1. Make sure on the Advanced Options page both checkboxes are checked
  1. Check Environment Variables
  1. Open 'Edit the system environment variables'
  1. Just search in the Windows application search bar
  1. Click Environment Variables... in the bottom right
  2. Make sure there is a PATH variable that contains the value 'c:nrnbin'
  1. To check, double click on the PATH variable
  2. If the PATH variable is not one of your environment variables, add it,
    and give it the value 'c:nrnbin'
  3. If the PATH variable exists but does not contain the value 'c:nrnbin'
    add a new value, and make it 'c:nrnbin
  1. Make sure there is a PYTHONPATH variable that contains the value 'c:nrnlibpython'
  1. To check, double click on the PYTHONPATH variable
  2. If the PYTHONPATH variable is not one of your environment variables, add it,
    and give it the value 'c:nrnlibpython'
  3. If the PYTHONPATH variable exists but does not contain the value
    'c:nrnlibpython' add a new value, and make it 'c:nrnlibpython'
  1. Launch Anaconda
  1. Launch the Anaconda Prompt application
  2. Type 'python' then hit enter
  3. You should now get a '>>>' for the new line
  1. This means you can now enter python code
  1. Type 'import neuron' and hit enter
  1. You should get the following message:
NEURON -- VERSION 7.5 master (6b4c19f) 2017-09-25 Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016 See http://neuron.yale.edu/neuron/credits
  1. If not check that your environment variables are setup correctly (refer to step 3)
  1. Running Simulations
  1. From the Anaconda Prompt you can run the following
  1. Python line by line as it is entered, by first typing the 'python' command
  2. By running python files with the 'python <insert path to file>' command
ex. python C:nrntest0.py
  1. Using Visual Studio code downloaded through Anaconda
  1. Setting Up R
  1. Download Visual Studio Community : https://visualstudio.microsoft.com/downloads/
  2. Install VS, and install the Data Science and Analytical Application package
  3. Get the sample project from : https://docs.microsoft.com/en-us/visualstudio/rtvs/getting-started-samples
  4. Run the 2 R scripts within the A first look at R folder