Last modified by adavison on 2022/10/04 13:53

From version 37.3
edited by shailesh
on 2021/10/14 17:22
Change comment: There is no comment for this version
To version 27.15
edited by shailesh
on 2021/10/08 11:21
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -02. Installing PyNN - Linux
1 +02. Installing PyNN
Content
... ... @@ -1,6 +1,12 @@
1 +(% class="box warningmessage" %)
2 +(((
3 +tutorials under development for Linux, Mac OS, Windows, Jupyter Lab.
4 +)))
5 +
6 +
1 1  == Learning objectives ==
2 2  
3 -In this tutorial, you will learn how to install PyNN, together with the NEST, NEURON and Brian 2 simulators, on Linux.
9 +In this tutorial, you will learn how to install PyNN, together with the NEST, NEURON and Brian 2 simulators, on Linux / Mac OS / Windows / in EBRAINS Jupyter Lab.
4 4  
5 5  (% class="box infomessage" %)
6 6  (((
... ... @@ -37,7 +37,7 @@
37 37  **Slide** listing learning objectives
38 38  )))
39 39  
40 -In this tutorial, I will guide you through setting up PyNN, together with the NEST, NEURON and Brian 2 simulators, on a Linux  environment. Note that we have a dedicated version of this tutorial for other environments, such as Mac OS, Windows and EBRAINS Jupyter Lab.
46 +In this tutorial, I will guide you through setting up PyNN, together with the NEST, NEURON and Brian 2 simulators, in a Linux  environment. Note that we have a dedicated version of this tutorial for other environments, such as Mac OS, Windows and EBRAINS Jupyter Lab.
41 41  
42 42  (% class="box successmessage" %)
43 43  (((
... ... @@ -96,7 +96,7 @@
96 96  (% class="box infomessage" %)
97 97  (((
98 98  **Screencast** - file explorer
99 -\\(% style="color:#000000" %)<< show directory contents; especially lib/python3.8/site-packages >>
105 +\\(% style="color:#000000" %)<< show directory contents; especially lib/python3.9/site-packages >>
100 100  )))
101 101  
102 102  As you see here, only a limited number of basic packages have currently been installed in this virtual environment. In the steps ahead, we shall install various other packages, and you shall see that these would be reflected here.
... ... @@ -117,15 +117,8 @@
117 117  \\You might be required to run the above command every time you open a new terminal window. Do verify that the terminal command prompt indicates the name of your virtual environment to confirm that you have indeed activated it.
118 118  )))
119 119  
120 -Now that we have our project's virtual environment setup, we are now ready to install PyNN and other simulators. In general, it is advisable to install the various simulators (especially NEURON and NEST) prior to installing PyNN, because PyNN will then auto compile NEURON's NMODL fles and NEST's extensions during installation. In this tutorial, we will adopt this approach and begin by installing the simulators. For the purposes of this tutorial, we shall demonstrate the installation of Brian2, NEURON and NEST simulators.
126 +Now that we have our project's virtual environment setup, we are now ready to install PyNN and other simulators. In general, it is advisable to install the various simulators (especially NEURON and NEST) prior to installing PyNN, because PyNN will then auto compile NEURON's NMODL fles and NEST's extensions during installation. Alternatively, this would need to be done manually as described on the PyNN website. In this tutorial, we will adopt the easier approach and begin by installing the simulators. For the purposes of this tutorial, we shall demonstrate the installation of Brian2, NEURON and NEST simulators.
121 121  
122 -(% class="box errormessage" %)
123 -(((
124 -**Note:**
125 -\\If you have previously already installed NEURON or NEST on your system and are installing PyNN now, then you would require to compile NEURON's NMODL fles and NEST's extensions manually. For more instructions on this, take a look at:
126 -[[(% style="color:#000000" %)http:~~/~~/neuralensemble.org/docs/PyNN/installation.html>>http://neuralensemble.org/docs/PyNN/installation.html]]
127 -)))
128 -
129 129  We start here with the installation of Brian 2. Brian 2 can be installed simply using the pip command.
130 130  
131 131  (% class="box infomessage" %)
... ... @@ -139,7 +139,7 @@
139 139  (% class="box infomessage" %)
140 140  (((
141 141  **Screencast** - file explorer
142 -\\(% style="color:#000000" %)<< show directory contents lib/python3.8/site-packages >>
141 +\\(% style="color:#000000" %)<< show directory contents lib/python3.9/site-packages >>
143 143  )))
144 144  
145 145  To confirm that we have properly installed Brian 2 on our computer, we can test as follows:
... ... @@ -196,7 +196,7 @@
196 196  \\I find that I receive a "no module named nest" error, when trying this right after installing NEST. But it succeeds after a restart. So if you do observe an error, close all programs and restart your computer, and try again. This time it should execute as expected.
197 197  )))
198 198  
199 -If there are no error messages here, and the import is successful, then we have completed installing NEST simulator, and are able to load it via Python.
198 +If there are no error messages here, and the import is successful, then we have completed installing NEST simulator, and are able to load it on Python.
200 200  
201 201  We next move on to the third simulator, NEURON. The installation for NEURON used to be more involved previously, but can now be easily completed using the 'pip' command:
202 202  
... ... @@ -211,8 +211,7 @@
211 211  (% class="box infomessage" %)
212 212  (((
213 213  **Screencast** - terminal
214 -\\(% style="color:#000000" %)nrniv
215 -\\quit()
213 +\\(% style="color:#000000" %)nrngui
216 216  )))
217 217  
218 218  This will display the NEURON banner, which mentions the version amongst other info. Here, as we can see, we have now installed NEURON v8.0.0 on our system. Let us next verify that this is indeed accessible via Python.
... ... @@ -225,67 +225,17 @@
225 225  \\exit()
226 226  )))
227 227  
228 -If there are no error messages here, and the import is successful, then we have completed installing NEURON simulator, and are able to load it via Python.
229 229  
230 -Now that we have installed all the simulators we intend to use, we move on to installing PyNN itself. As PyNN is a Python package, we can install it easily using the 'pip' command:
231 231  
232 -(% class="box infomessage" %)
233 -(((
234 -**Screencast** - terminal
235 -\\(% style="color:#000000" %)pip install PyNN
236 -)))
237 -
238 -(% class="box warningmessage" %)
239 -(((
240 -**Note:**
241 -\\Note that PyNN project is spelt with a captial P, small y, and two captital N. The pip command is case-insensitive, so you may write it differently here. But the Python module, as we shall see ahead, is case-sensitive and is spelt starting with a small P. This is in line with general Python convention, whereby package names start with small alphabets. Thus, while importing PyNN module via Python, it needs to be written as 'pyNN'.
242 -)))
243 -
244 -To verify that PyNN has been successfully installed on our system, and that it is indeed able to communicate with the other simulators that we installed earlier, we can try running:
245 -
246 -(% class="box infomessage" %)
247 -(((
248 -**Screencast** - terminal
249 -
250 -(% style="color:#000000" %)python
251 -\\import pyNN.brian2 as sim
252 -
253 -(% style="color:#000000" %)sim.setup()
254 -
255 -(% style="color:#000000" %)sim.end()
256 -)))
257 -
258 -This confirms that PyNN has been properly setup, and also that is able to employ Brian 2. To verify similary that PyNN is also able to communicate with NEURON and NEST simulators:
259 -
260 -(% class="box infomessage" %)
261 -(((
262 -**Screencast** - terminal
263 -
264 -(% style="color:#000000" %)python
265 -\\import pyNN.nest as sim
266 -
267 -(% style="color:#000000" %)sim.setup()
268 -
269 -(% style="color:#000000" %)sim.end()
270 -
271 -
272 -
273 -(% style="color:#000000" %)import pyNN.neuron as sim
274 -
275 -(% style="color:#000000" %)sim.setup()
276 -
277 -(% style="color:#000000" %)sim.end()
278 -)))
279 -
280 -This confirms that all the required software packages have been successfully completed, and are functioning as expected.
281 -
282 282  (% class="box successmessage" %)
283 283  (((
284 284  **Slide** recap of learning objectives
285 285  )))
286 286  
287 -That is the end of this tutorial, in which I've demonstrated how to install PyNN, and other required simulators, in a Linux system. You are now ready to start modeling! To learn about model development in PyNN, do take a look at our next tutorial. Also, we will be releasing a series of tutorials, throughout the rest of 2021 and 2022, to introduce these more advanced features of PyNN, so keep an eye on the EBRAINS website.
233 +That is the end of this tutorial, in which I've demonstrated how to install PyNN, and other required simulators, in a Linux system. You are now ready to start modeling! To learn about model development in PyNN, do take a look at our next tutorial.
288 288  
235 +Als,  we will be releasing a series of tutorials, throughout the rest of 2021 and 2022, to introduce these more advanced features of PyNN, so keep an eye on the EBRAINS website.
236 +
289 289  (% class="box successmessage" %)
290 290  (((
291 291  **Slide** useful links
... ... @@ -295,7 +295,6 @@
295 295  [[(% style="color:#000000" %)https:~~/~~/neuron.yale.edu/neuron/>>https://neuron.yale.edu/neuron/]]
296 296  )))
297 297  
298 -We have listed here some links that might be of interest to users who wish to find more details about the various softwares employed in this tutorial.
299 299  
300 300  (% class="box successmessage" %)
301 301  (((