# Issue running the vector\_addition example

**URL:** <https://forum.modular.com/t/issue-running-the-vector-addition-example/2273>\
**Category:** LSP\
**Created:** [September 15, 2025, 11:04pm UTC](https://forum.modular.com/t/issue-running-the-vector-addition-example/2273 "2025-09-15T23:04:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepak.cu](https://avatars.discourse-cdn.com/v4/letter/d/5f8ce5/32.png) [@deepak.cu](https://forum.modular.com/u/deepak.cu)\
**Post date:** [September 15, 2025, 11:04pm UTC](https://forum.modular.com/t/issue-running-the-vector-addition-example/2273/1 "2025-09-15T23:04:59Z")

</div>

Hello, I followed instructions in [GitHub - modular/modular: The Modular Platform (includes MAX & Mojo)](https://github.com/modular/modular)

```auto
pip install modular

```

> When I run the vector additition example under `modular/examples/custom_ops/kernels`, I get this error:
> 
> mojo run vector\_addition.mojo  
> /home/lab/username/modular/examples/custom\_ops/kernels/vector\_addition.mojo:74:2: error: ‘VectorAddition’ has no ‘compiler’ member  
> @compiler.register(“vector\_addition”)  
> ^ ~~~~~~~  
> /home/lab/username/venv/bin/mojo: error: failed to parse the provided Mojo source module

Mojo version is

> mojo --version  
> Mojo 25.5.0 (573c06a4)

---

<div class="post-metadata">

**Author:** ![deepak.cu](https://avatars.discourse-cdn.com/v4/letter/d/5f8ce5/32.png) [@deepak.cu](https://forum.modular.com/u/deepak.cu)\
**Post date:** [September 15, 2025, 11:26pm UTC](https://forum.modular.com/t/issue-running-the-vector-addition-example/2273/2 "2025-09-15T23:26:48Z")

</div>

I notice that many examples also fail to compile. For example,

> ~/username/modular/examples/mojo$ mojo run mandelbrot.mojo  
> /home/lab/username/modular/examples/mojo/mandelbrot.mojo:15:42: error: module ‘info’ does not contain ‘simd\_width\_of’  
> from sys.info import num\_physical\_cores, simd\_width\_of  
> ^  
> /home/lab/username/modular/examples/mojo/mandelbrot.mojo:55:41: error: no matching function in initialization  
> var t = SIMDDType.bool, simd\_width  
> ~~~~~~~~~~~~~~~~~~~~^~~

nbody:

> mojo run nbody.mojo  
> /home/lab/username/modular/examples/mojo/nbody.mojo:28:15: error: ‘Planet’ has no ‘ImplicitlyCopyable’ member  
> struct Planet(ImplicitlyCopyable, Movable):

---

<div class="post-metadata">

**Author:** ![Ehsan](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/ehsan/32/142_2.png) [@Ehsan](https://forum.modular.com/u/Ehsan)\
**Post date:** [September 16, 2025, 4:47pm UTC](https://forum.modular.com/t/issue-running-the-vector-addition-example/2273/3 "2025-09-16T16:47:36Z")

</div>

Sorry you have installation issues. Please first check if the [Packages | Modular](https://docs.modular.com/max/packages#system-requirements) are met. Then the `main` branch is tracking the nightly releases and `pip install modular` installs the latest stable [Packages | Modular](https://docs.modular.com/max/packages#install) version which is currently `25.5`. So

```auto
git clone https://github.com/modular/modular
cd modular
git checkout modular/v25.5
cd modular/examples/mojo

```

For pip, it’s highly recommended to use virtual environment so

```auto
# make sure no env is active
python -m venv venv
source venv/bin/activate
python -m pip install modular

```

The `modular` package is a meta-package that includes everything such as `mojo-compiler` , `mojo` (dev dependencies such as formater, LSP etc.) and `max`

Now check `mojo –-version` should match the tag `Mojo 25.5.0 (573c06a4)`

Then run

```auto
mojo mandelbrot.mojo 
Number of physical cores: 12
Vectorized: 11.305873239436618 ms
Parallelized: 2.309573 ms
Parallel speedup: 4.895222294093592

```

For the [custom\_ops examples](https://github.com/modular/modular/tree/main/examples/custom_ops), the kernels are meant to be used with `max` python graph api so we can run the vector addition example via (`cd custom_ops`)

```auto
python vector_addition.py

```

outputs like

```auto
Left-hand-side values:
[0.37531552 0.16229668 0.39715832 0.6472096 0.20262577 0.4971949
 0.24008769 0.9813841 0.37782624 0.37180763]

Right-hand-side values:
[0.925224 0.32441604 0.32967967 0.30302358 0.36905172 0.57079685
 0.35871768 0.14324683 0.10780976 0.15608703]

Graph result:
[1.3005395 0.48671272 0.726838 0.95023316 0.5716775 1.0679917
 0.59880537 1.1246309 0.485636 0.5278947 ]

Expected result:
[1.3005395 0.48671272 0.726838 0.95023316 0.5716775 1.0679917
 0.59880537 1.1246309 0.485636 0.5278947 ]

```

Generally for best environment and package/dependency management experience we recommend to use either [pixi](https://pixi.sh/latest/#installation) or [uv](https://docs.astral.sh/uv/getting-started/installation/).

With pixi there’s no need to manually handing venv, python version etc. For example in the case of `custom_ops` can do `pixi run vector_addition` where pixi handles everything correctly [here](https://github.com/modular/modular/blob/main/examples/custom_ops/pixi.toml#L12).

If you’re interested about GPU programming in Mojo, please check out [GitHub - modular/mojo-gpu-puzzles: Learn GPU Programming in Mojo🔥 by Solving Puzzles](https://github.com/modular/mojo-gpu-puzzles) .

---

<div class="post-metadata">

**Author:** ![deepak.cu](https://avatars.discourse-cdn.com/v4/letter/d/5f8ce5/32.png) [@deepak.cu](https://forum.modular.com/u/deepak.cu)\
**Post date:** [September 22, 2025, 4:33pm UTC](https://forum.modular.com/t/issue-running-the-vector-addition-example/2273/4 "2025-09-22T16:33:58Z")

</div>

Thanks for your response.

My system meets requirements. I followed above instructions.

```auto
root@compute-system:/mnt/nvme/deepaku/modular_test# git clone https://github.com/modular/modular
Cloning into 'modular'...
remote: Enumerating objects: 231880, done.
remote: Counting objects: 100% (155/155), done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 231880 (delta 132), reused 98 (delta 98), pack-reused 231725 (from 3)
Receiving objects: 100% (231880/231880), 109.37 MiB | 8.17 MiB/s, done.
Resolving deltas: 100% (179786/179786), done.
root@compute-system:/mnt/nvme/deepaku/modular_test# cd modular/
root@compute-system:/mnt/nvme/deepaku/modular_test/modular# git checkout modular/v25.5
Branch 'modular/v25.5' set up to track remote branch 'modular/v25.5' from 'origin'.
Switched to a new branch 'modular/v25.5'
root@compute-system:/mnt/nvme/deepaku/modular_test/modular# cd examples/mojo/
root@compute-system:/mnt/nvme/deepaku/modular_test/modular/examples/mojo# python3 --version
Python 3.10.18
root@compute-system:/mnt/nvme/deepaku/modular_test/modular/examples/mojo# python3 -m venv venv

(venv) root@compute-system:/mnt/nvme/deepaku/modular_test/modular/examples/mojo# python -m pip install modular

```

mojo version returned 0.25.6.0

```auto
(venv) root@compute-system:/mnt/nvme/deepaku/modular_test/modular/examples/mojo# mojo --version
Mojo 0.25.6.0 (06be5aab)

```

I get this error on the example under modular/examples/mojo/

```auto
(venv) root@compute-system:/mnt/nvme/deepaku/modular_test/modular/examples/mojo# mojo mandelbrot.mojo
/mnt/nvme/deepaku/modular_test/modular/examples/mojo/mandelbrot.mojo:23:36: error: cannot pass 'DType' value, expected 'AnyTrivialRegType' in call parameter
alias simd_width = 2 * simdwidthof[float_type]()

```

But the example under gpu-functions ran fine.

```auto
mojo ./gpu-functions/mandelbrot.mojo
...................................,,,,c@8cc,,,.............
...............................,,,,,,cc8M @Mjc,,,,..........
............................,,,,,,,ccccM@aQaM8c,,,,,........
..........................,,,,,,,ccc88g.o. Owg8ccc,,,,......
.......................,,,,,,,,c8888M@j, ,wMM8cccc,,.....
.....................,,,,,,cccMQOPjjPrgg, OrwrwMMMjjc,....
..................,,,,cccccc88MaP @ ,pGa.g8c,...
...............,,cccccccc888MjQp. o@8cc,..
..........,,,,c8jjMMMMMMMMM@@w. aj8c,,.
.....,,,,,,ccc88@QEJwr.wPjjjwG w8c,,.
....,,,,,cccccMMjwQ EpQ .8c,,,
....,,,cc888MrajwJ MMcc,,,
.cc88jMMM@@jaG. oM8cc,,,
....8jMMM@@jaG. oM8cc,,,
....,,,cc888MrajwJ MMcc,,,
....,,,,,cccccMMjwQ EpQ .8c,,,
.....,,,,,,ccc88@QEJwr.wPjjjwG w8c,,.
..........,,,,c8jjMMMMMMMMM@@w. aj8c,,.
...............,,cccccccc888MjQp. o@8cc,..
..................,,,,cccccc88MaP @ ,pGa.g8c,...
.....................,,,,,,cccMQOEjjPrgg, OrwrwMMMjjc,....
.......................,,,,,,,,c8888M@j, ,wMM8cccc,,.....
..........................,,,,,,,ccc88g.o. Owg8ccc,,,,......
............................,,,,,,,ccccM@aQaM8c,,,,,........
...............................,,,,,,cc8M @Mjc,,,,..........

```

---

<div class="post-metadata">

**Author:** ![BradLarson](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/bradlarson/32/62_2.png) [@BradLarson](https://forum.modular.com/u/BradLarson)\
**Post date:** [September 22, 2025, 5:51pm UTC](https://forum.modular.com/t/issue-running-the-vector-addition-example/2273/5 "2025-09-22T17:51:09Z")

</div>

We just pushed new packages, so it looks like your `pip install modular` is now using the 0.25.6 version of `mojo` , and as a result you’ll want refresh the `modular` repository and check out the `modular/v25.6` branch to match the new version of Mojo.

We’ve migrated the Mojo numbering from `25.5` → `0.25.6` to prepare for eventual semantic version of the language.
