# Brian2Cuda not compatible with Brian 2.5.4

**URL:** <https://brian.discourse.group/t/brian2cuda-not-compatible-with-brian-2-5-4/1223>\
**Category:** Support\
**Created:** [28 May 2024 09:48 UTC](https://brian.discourse.group/t/brian2cuda-not-compatible-with-brian-2-5-4/1223 "2024-05-28T09:48:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![raresdorcioman](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/raresdorcioman/32/730_2.png) [@raresdorcioman](https://brian.discourse.group/u/raresdorcioman)\
**Post date:** [28 May 2024 09:48 UTC](https://brian.discourse.group/t/brian2cuda-not-compatible-with-brian-2-5-4/1223/1 "2024-05-28T09:48:19Z")

</div>

# Description of problem

Hi everyone,

I am trying to use brian2cuda to speed up computations in my project in which I am also using Dendrify ([Dendrify 2.2.0](https://dendrify.readthedocs.io/en/latest/)). The problem is that Dendrify seems to require version brian2==2.5.4, but brian2cuda requires version brian2==2.6.0. Is there a way to install brian2cuda so that it is compatible with brian2 version 2.5.4?

# What you have already tried

I tried to install brian2 after installing brian2cuda (first installed brian2cuda with pip install brian2cuda, then uninstalled brian2 with pip and then did pip install brian2==2.5.4)

ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.  
brian2cuda 1.0a4 requires brian2==2.6.0, but you have brian2 2.5.4 which is incompatible.

When I install Dendrify (pip install dendrify --no-deps) and then install brian2cuda using ‘python -m pip install brian2cuda’, I get the following error:

ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.  
dendrify 2.1.2 requires brian2==2.5.4, but you have brian2 2.6.0 which is incompatible.

I also tried the following:

- installed Dendrify with no dependencies pip install dendrify --no-deps
- installed Brian2 version: pip install brian2==2.5.4
- then installed brian2cuda with no dependencies with ‘pip install --no-deps brian2cuda’

but when I run brian2cuda.example\_run(), I get:  
Traceback (most recent call last):  
File “”, line 1, in   
File “/home/rad216/miniconda3/envs/test\_brian2cuda/lib/python3.12/site-packages/brian2cuda/ **init**.py”, line 72, in example\_run  
run(1 \* ms)  
File “/home/rad216/miniconda3/envs/test\_brian2cuda/lib/python3.12/site-packages/brian2/units/fundamentalunits.py”, line 2780, in new\_f  
result = f(\*args, \*\*kwds)  
^^^^^^^^^^^^^^^^  
File “/home/rad216/miniconda3/envs/test\_brian2cuda/lib/python3.12/site-packages/brian2/core/magic.py”, line 407, in run  
return magic\_network.run(  
^^^^^^^^^^^^^^^^^^  
File “/home/rad216/miniconda3/envs/test\_brian2cuda/lib/python3.12/site-packages/brian2/core/magic.py”, line 248, in run  
Network.run(  
File “/home/rad216/miniconda3/envs/test\_brian2cuda/lib/python3.12/site-packages/brian2/core/base.py”, line 333, in device\_override\_decorated\_function  
return getattr(curdev, name)(\*args, \*\*kwds)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/home/rad216/miniconda3/envs/test\_brian2cuda/lib/python3.12/site-packages/brian2cuda/device.py”, line 1704, in network\_run  
if not self.run\_args\_applied:  
^^^^^^^^^^^^^^^^^^^^^  
AttributeError: ‘CUDAStandaloneDevice’ object has no attribute ‘run\_args\_applied’

which tells me that the brian2 version is not compatible with the brian2cuda version.

Any idea how I can resolve this conflict and use brian2cuda with Brian2 version 2.5.4?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [28 May 2024 10:22 UTC](https://brian.discourse.group/t/brian2cuda-not-compatible-with-brian-2-5-4/1223/2 "2024-05-28T10:22:39Z")

</div>

Hi @raresdorcioman. The latest version of `brian2cuda` requires Brian version 2.6, as you saw, but the previous version (1.0a3) is compatible with Brian 2.5.4. For situations like this, it is usually the best to install all the packages that you need to be compatible with each other in a single command. The `pip` tool should then automatically figure out that Brian2cuda 1.0a3, Brian2 2.5.4, and dendrify 2.1.2 are compatible with each other:

```console
$ pip install dendrify brian2 brian2cuda

```

Hope that helps!

---

<div class="post-metadata">

**Author:** ![raresdorcioman](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/raresdorcioman/32/730_2.png) [@raresdorcioman](https://brian.discourse.group/u/raresdorcioman)\
**Post date:** [28 May 2024 11:11 UTC](https://brian.discourse.group/t/brian2cuda-not-compatible-with-brian-2-5-4/1223/3 "2024-05-28T11:11:47Z")

</div>

Thanks a lot! That actually solved the installation conflicts! I’ll see how it goes with the actual usage of the GPU tools 🙂

---

<div class="post-metadata">

**Author:** ![mpagkalos](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mpagkalos/32/416_2.png) [@mpagkalos](https://brian.discourse.group/u/mpagkalos)\
**Post date:** [5 June 2024 12:06 UTC](https://brian.discourse.group/t/brian2cuda-not-compatible-with-brian-2-5-4/1223/4 "2024-06-05T12:06:31Z")

</div>

Hi @raresdorcioman,

My name is Michalis and I am the main developer of Dendrify. Dendrify is actually fully compatible with Brian 2.6 but I set as a requirement Brian 2.5.4. because Brian2cuda used to require this version as well. I apologize for any inconvenience regarding installation conflicts with Brian. I was writing my PhD thesis and paused its development for a while.

@mstimberg As you mentioned brian2cuda works with Brian 2.6 right? If yes, then I need to change its requirements in the PyPI setup file!

UPDATE:  
I just updated dendrify to version 2.1.3 that resolved the above issue. If you come across any other weird errors please let me know. Thanks!

---

<div class="post-metadata">

**Author:** ![raresdorcioman](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/raresdorcioman/32/730_2.png) [@raresdorcioman](https://brian.discourse.group/u/raresdorcioman)\
**Post date:** [6 June 2024 09:49 UTC](https://brian.discourse.group/t/brian2cuda-not-compatible-with-brian-2-5-4/1223/5 "2024-06-06T09:49:18Z")

</div>

Hi Michalis, thank you for the update and for solving this!

---

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [6 June 2024 11:44 UTC](https://brian.discourse.group/t/brian2cuda-not-compatible-with-brian-2-5-4/1223/6 "2024-06-06T11:44:52Z")

</div>

> [@mpagkalos](#):
>
> @mstimberg As you mentioned brian2cuda works with Brian 2.6 right? If yes, then I need to change its requirements in the PyPI setup file!

Yes – but actually I am in the process of pushing out Brian 2.7 and Brian2CUDA 1.0a5, so you might have to do the same thing yet again soon 😬 Not urgent, though, the main change in Brian 2.7 vs. 2.6 is that it is compatible with numpy 2.0 (which hasn’t been released yet).

---

<div class="post-metadata">

**Author:** ![mpagkalos](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mpagkalos/32/416_2.png) [@mpagkalos](https://brian.discourse.group/u/mpagkalos)\
**Post date:** [6 June 2024 13:09 UTC](https://brian.discourse.group/t/brian2cuda-not-compatible-with-brian-2-5-4/1223/7 "2024-06-06T13:09:12Z")

</div>

Haha, good to know. Thank you for another Brian update \<3.
