Description of problem
Hello!
I copied the code of the “lfp” example from Brian’s documentation, and it throws an error (the exact message below). I was surprised to see that the this example do work on the binder notebook on web, so I guess it’s might be related with my settings of the project (I use python version 3.9), but I can’t guess why.
Minimal code to reproduce problem
the code exists here: Example: lfp — Brian 2 2.4.2 documentation
What you have aready tried
Expected output (if relevant)
Actual output (if relevant)
Full traceback of error (if relevant)
WARNING The expression “1 / 20” divides two integer values. In previous versions of Brian, this would have used either an integer (“flooring”) or a floating point division, depending on the Python version and the code generation target. In the current version, it always uses a floating point division. Explicitly ask for an integer division ("//"), or turn one of the operands into a floating point value (e.g. replace “1/2” by “1.0/2”) to no longer receive this warning. [brian2.parsing.bast.floating_point_division]
WARNING The expression “5 / 2” divides two integer values. In previous versions of Brian, this would have used either an integer (“flooring”) or a floating point division, depending on the Python version and the code generation target. In the current version, it always uses a floating point division. Explicitly ask for an integer division ("//"), or turn one of the operands into a floating point value (e.g. replace “1/2” by “1.0/2”) to no longer receive this warning. [brian2.parsing.bast.floating_point_division]
WARNING The expression “1 / 18” divides two integer values. In previous versions of Brian, this would have used either an integer (“flooring”) or a floating point division, depending on the Python version and the code generation target. In the current version, it always uses a floating point division. Explicitly ask for an integer division ("//"), or turn one of the operands into a floating point value (e.g. replace “1/2” by “1.0/2”) to no longer receive this warning. [brian2.parsing.bast.floating_point_division]
WARNING The expression “1 / 80” divides two integer values. In previous versions of Brian, this would have used either an integer (“flooring”) or a floating point division, depending on the Python version and the code generation target. In the current version, it always uses a floating point division. Explicitly ask for an integer division ("//"), or turn one of the operands into a floating point value (e.g. replace “1/2” by “1.0/2”) to no longer receive this warning. [brian2.parsing.bast.floating_point_division]
ERROR Brian 2 encountered an unexpected error. If you think this is a bug in Brian 2, please report this issue either to the discourse forum at…, or to the issue tracker at … Please include this file with debug information in your report: C:\Users\owner\AppData\Local\Temp\brian_debug_ah0st350.log Additionally, you can also include a copy of the script that was run, available at: C:\Users\owner\AppData\Local\Temp\brian_script_xm7jx727.py You can also include a copy of the redirected std stream outputs, available at C:\Users\owner\AppData\Local\Temp\brian_stdout_ok5eo3nn.log and C:\Users\owner\AppData\Local\Temp\brian_stderr_1sgeqleo.log Thanks! [brian2]
Traceback (most recent call last):
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\core\network.py”, line 897, in before_run
obj.before_run(run_namespace)
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\groups\group.py”, line 1143, in before_run
self.create_code_objects(run_namespace)
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\groups\group.py”, line 1136, in create_code_objects
code_object = self.create_default_code_object(run_namespace)
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\groups\group.py”, line 1118, in create_default_code_object
self.codeobj = create_runner_codeobj(group=self.group,
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\codegen\codeobject.py”, line 441, in create_runner_codeobj
return device.code_object(owner=group,
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\devices\device.py”, line 297, in code_object
scalar_code, vector_code, kwds = generator.translate(abstract_code,
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\codegen\generators\base.py”, line 262, in translate
translated = self.translate_statement_sequence(scalar_statements,
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\codegen\generators\cython_generator.py”, line 208, in translate_statement_sequence
kwds = self.determine_keywords()
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\codegen\generators\cython_generator.py”, line 364, in determine_keywords
user_func = self._add_user_function(varname, var, added)
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\codegen\generators\cython_generator.py”, line 220, in _add_user_function
func_code = impl.get_code(self.owner)
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\core\functions.py”, line 280, in get_code
self.availability_check()
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\codegen\cpp_prefs.py”, line 278, in call
raise NotImplementedError('The “{}” function needs C99 compiler ’
NotImplementedError: The “exprel” function needs C99 compiler support
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “C:\Users\owner\PycharmProjects\spikeSorting\Simulator.py”, line 90, in
run(50*ms, report=‘text’)
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\units\fundamentalunits.py”, line 2434, in new_f
result = f(*args, **kwds)
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\core\magic.py”, line 373, in run
return magic_network.run(duration, report=report, report_period=report_period,
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\core\magic.py”, line 231, in run
Network.run(self, duration, report=report, report_period=report_period,
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\core\base.py”, line 278, in device_override_decorated_function
return func(*args, **kwds)
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\units\fundamentalunits.py”, line 2434, in new_f
result = f(*args, kwds)
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\core\network.py”, line 1008, in run
self.before_run(namespace)
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\core\base.py”, line 278, in device_override_decorated_function
return func(args, **kwds)
File “C:\Users\owner\PycharmProjects\spikeSorting\venv\lib\site-packages\brian2\core\network.py”, line 899, in before_run
raise BrianObjectException(“An error occurred when preparing an object.”, obj) from ex
brian2.core.base.BrianObjectException: Error encountered with object named “spatialneuron_stateupdater”.
Object was created here (most recent call only, full details in debug log):
File “C:\Users\owner\PycharmProjects\spikeSorting\Simulator.py”, line 65, in
neuron = SpatialNeuron(morphology=morpho, model=eqs, Cm=1uF/cm2,