# First Steps: ValueError("No context detected.")

**URL:** <https://forum.compas-framework.org/t/first-steps-valueerror-no-context-detected/886>\
**Category:** Uncategorized\
**Created:** [August 7, 2024, 11:16am UTC](https://forum.compas-framework.org/t/first-steps-valueerror-no-context-detected/886 "2024-08-07T11:16:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mononym](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/mononym/32/211_2.png) [@mononym](https://forum.compas-framework.org/u/mononym)\
**Post date:** [August 7, 2024, 11:16am UTC](https://forum.compas-framework.org/t/first-steps-valueerror-no-context-detected/886/1 "2024-08-07T11:16:16Z")

</div>

Hello. Just trying out the COMPAS v2 by following the docs and hit an error on the very first steps.  
I don’t see where it went wrong (according to the documentation):

```auto
$ conda create -n compas-2 -c conda-forge python=3.10 compas
$ conda activate compas-2
$ python a_simple_box.py

```

Error:

```auto
Traceback (most recent call last):
  File "~/a_simple_box.py", line 8, in <module>
    scene.draw()
  File "~/Applications/miniconda3/envs/compas-2/lib/python3.10/site-packages/compas/scene/scene.py", line 131, in draw
    raise ValueError("No context detected.")
ValueError: No context detected.

```

a\_simple\_box.py

```auto
from compas.geometry import Box
from compas.scene import Scene

box = Box(1, 1, 1)

scene = Scene()
scene.add(box)
scene.draw()

```

I share this because I don’t want anybody to turn away from compas while following the docs to get started; as I think it’s a fantastic project on which I built my research !

---

<div class="post-metadata">

**Author:** ![chenkasirer](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/chenkasirer/32/549_2.png) [@chenkasirer](https://forum.compas-framework.org/u/chenkasirer)\
**Post date:** [August 9, 2024, 8:21am UTC](https://forum.compas-framework.org/t/first-steps-valueerror-no-context-detected/886/2 "2024-08-09T08:21:12Z")

</div>

Hi @mononym

Sorry you’re having an issue trying the example.  
Using the `Scene` alone requires some kind of a visualization context to be available (CAD).

If you run the example code within Rhino/Grasshopper/Blender, the `Scene` should automatically detect one of them as the current context.

For standalone COMPAS visualization you can always use [compas\_viewer](https://compas.dev/compas_viewer/latest/index.html):

Install compas\_viewer

```auto
pip install compas_viewer

```

Your script then would need to look like that:

```python3
from compas.geometry import Box
from compas_viewer.viewer import Viewer

box = Box(1, 1, 1)

viewer = Viewer()
viewer.scene.add(box)
viewer.show()

```

It is mentioned in the `First Steps` page but I’ll see if we can make the note there a bit clearer.
