TypeError: Array of type 'long' required. Array of type 'long long' given

Description of problem

I installed python(2.7.18), brian(1.4.4), and scipy(1.2.3) and then I tried to run a code in https://brian.readthedocs.io/en/stable/introduction.html. The error “TypeError: Array of type ‘long’ required. Array of type ‘long long’ given” is occurred.

Minimal code to reproduce problem

This is a code in the above link.

from brian import *
eqs='''
dv/dt = (ge+gi-(v+49*mV))/(20*ms) : volt
dge/dt = -ge/(5*ms) : volt
dgi/dt = -gi/(10*ms) : volt
'''
P=NeuronGroup(4000,model=eqs,threshold=-50*mV,reset=-60*mV)
P.v=-60*mV
Pe=P.subgroup(3200)
Pi=P.subgroup(800)
Ce=Connection(Pe,P,'ge',weight=1.62*mV,sparseness=0.02)
Ci=Connection(Pi,P,'gi',weight=-9*mV,sparseness=0.02)
M=SpikeMonitor(P)
run(1*second)
raster_plot(M)
show()

What you have aready tried

I tried to change the versions of python, brian, and scipy. But, I cannot resolve this issue.

Full traceback of error (if relevant)

Traceback (most recent call last):
  File "C:/Users/chansik/github/test_brian/main.py", line 14, in <module>
    run(1*second)
  File "C:\ProgramData\Anaconda3\envs\brian\lib\site-packages\brian\network.py", line 938, in run
    report=report, report_period=report_period)
  File "C:\ProgramData\Anaconda3\envs\brian\lib\site-packages\brian\network.py", line 574, in run
    self.update()
  File "C:\ProgramData\Anaconda3\envs\brian\lib\site-packages\brian\network.py", line 518, in update
    f()
  File "C:\ProgramData\Anaconda3\envs\brian\lib\site-packages\brian\neurongroup.py", line 516, in update
    self.LS.push(spikes) # Store spikes
  File "C:\ProgramData\Anaconda3\envs\brian\lib\site-packages\brian\utils\ccircular\ccircular.py", line 128, in push
    def push(self, *args): return _ccircular.SpikeContainer_push(self, *args)
TypeError: Array of type 'long' required.  Array of type 'long long' given

Hi @chatterboy. The version of Brian you are using (Brian 1.x) has not been updated any more since a couple of years. It has been replaced by Brian 2, which comes with a range of new features and clearer syntax, while keeping most of it backwards-compatible. Therefore, if this is not about running some old existing Brian 1 code, please install Brian 2 instead. You can find more information on https://briansimulator.org and https://brian2.readthedocs.io. Brian 2’s CUBA example is very similar to the example code from the Brian 1 introduction.

Also note that Brian 1 only works on Python 2 whereas the recent versions of Brian 2 require Python 3.

1 Like

Okay. Thank you :slight_smile:

I will do something in Brian 2.