# Brian2CUDA import error even after installing utils

**URL:** <https://brian.discourse.group/t/brian2cuda-import-error-even-after-installing-utils/1315>\
**Category:** Support\
**Tags:** brian2cuda\
**Created:** [4 November 2024 11:47 UTC](https://brian.discourse.group/t/brian2cuda-import-error-even-after-installing-utils/1315 "2024-11-04T11:47:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeevan\_codes8580](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/jeevan_codes8580/32/786_2.png) [@Jeevan\_codes8580](https://brian.discourse.group/u/Jeevan_codes8580)\
**Post date:** [4 November 2024 11:47 UTC](https://brian.discourse.group/t/brian2cuda-import-error-even-after-installing-utils/1315/1 "2024-11-04T11:47:48Z")

</div>

# Description of problem

Hello and Good day. I was trying to run brian2toCuda. (was trying to run the example : [brian2cuda/examples/cobahh.py at b01fa83c9dae330b5415ce7c093bf4c7d914e950 · brian-team/brian2cuda · GitHub](https://github.com/brian-team/brian2cuda/blob/b01fa83c9dae330b5415ce7c093bf4c7d914e950/examples/cobahh.py) ). However while running , encountered the error : No module named ‘utils’ error for from utils import set\_prefs, update\_from\_command\_line. Now even installing utils using pip install utils does not solve the problem .

[system details : for now using colab and conda environment to not mess up my previous installations]

# Minimal code to reproduce problem

# What you have aready tried

# Expected output (if relevant)

# Actual output (if relevant)

# Full traceback of error (if relevant)

---

<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:** [4 November 2024 12:32 UTC](https://brian.discourse.group/t/brian2cuda-import-error-even-after-installing-utils/1315/2 "2024-11-04T12:32:43Z")

</div>

Hi @Jeevan_codes8580. The example you link to was used to do automatic benchmarking in many different configurations, so it is a bit more complex than you’d usually write it. The `utils` import refers to the `utils.py` file that is in the same directory ([brian2cuda/examples/utils.py at b01fa83c9dae330b5415ce7c093bf4c7d914e950 · brian-team/brian2cuda · GitHub](https://github.com/brian-team/brian2cuda/blob/b01fa83c9dae330b5415ce7c093bf4c7d914e950/examples/utils.py)), You’ll have to put it in the same directory from which you are running the `cobahh.py` example.

If you want to try out simpler examples, you can use most examples from the Brian2 documentation, e.g. [Example: COBAHH — Brian 2 2.7.1 documentation](https://brian2.readthedocs.io/en/stable/examples/COBAHH.html), and add the lines

```auto
import brian2cuda
set_device('cuda_standalone')

```

after the `brian2` import. But note that these examples are usually too small/simple to benefit from GPU acceleration.
