f.scene.light_manager.light_mode AttributeError when using %run in ipython
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 316
- Avg merge
- 7h 44m
- Merged PRs (30d)
- 5
Description
I saved the following python script in a file called `light_manager-test.py`:
```python
import mayavi.mlab as mlab
f=mlab.figure()
f.scene.light_manager.light_mode='vtk'
```
When from the ipython prompt I type `%run light_manager-test.py`, I get an AttributeError. `f.scene.light_manager` returns `none`.
However, the same commands work fine if I enter them into ipython line by line:

Why might this be? Should I try different backends? This is using qt.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the commands in light_manager-test.py through IPython's `%run` with the Qt backend, then compare that with entering them line by line. Investigate why `f.scene.light_manager` is `None` only during `%run`; done means the cause and a concrete fix or supported backend guidance are established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100