# mne.viz.plot\_alignmet() not working

**URL:** <https://mne.discourse.group/t/mne-viz-plot-alignmet-not-working/5773>\
**Category:** Support & Discussions\
**Created:** [October 21, 2022, 7:31am UTC](https://mne.discourse.group/t/mne-viz-plot-alignmet-not-working/5773 "2022-10-21T07:31:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Namsakhi](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/namsakhi/32/1985_2.png) [@Namsakhi](https://mne.discourse.group/u/Namsakhi)\
**Post date:** [October 21, 2022, 7:31am UTC](https://mne.discourse.group/t/mne-viz-plot-alignmet-not-working/5773/1 "2022-10-21T07:31:43Z")

</div>

- MNE version: e.g. 1.1.1
- operating system: e.g. Linux MInt

Hello All

**I am using VSCode on Linux mint. I first activate the mne virtual environment, now whenever I run the command**  
`fig = mne.viz.plot_alignment(raw.info, trans=trans, subject='sample', subjects_dir=subjects_dir, surfaces='head-dense', show_axes=True, dig=True, eeg=[], meg='sensors', coord_frame='meg', mri_fiducials='estimated')`  
**I see the following error:**

 ![S2](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/a/ae5c740e86745f9db8aed2186aeb1d5390426fab.png)

**I also tried then pip3 install pyvista and ipywidgets (after activation of mne\_fun virtual env), but nothing happens and the code still crashes.**  
**When I run:**  
`mne.sys_info()`  
**I don’t see pyvista in it even after doing pip install.**

 ![S1](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/7/7b0365ccf673513072ea5b3cfe83b11ca78c1666.png)

**Pleaseeeee can someone guide how to fix this issue. I also tried to pip uninstall and then reinstall pyvista.**  
Thank you!!

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [October 21, 2022, 8:09am UTC](https://mne.discourse.group/t/mne-viz-plot-alignmet-not-working/5773/2 "2022-10-21T08:09:21Z")

</div>

Hello @Namsakhi, and welcome to the forum!

I suggest to do a fresh install of MNE-Python following our official installation instructions, or using our stand-alone installer. Otherwise it can be difficult to get everything working correctly.

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![Namsakhi](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/namsakhi/32/1985_2.png) [@Namsakhi](https://mne.discourse.group/u/Namsakhi)\
**Post date:** [October 21, 2022, 9:41am UTC](https://mne.discourse.group/t/mne-viz-plot-alignmet-not-working/5773/3 "2022-10-21T09:41:29Z")

</div>

I figured out

```python
mne.viz.set_3d_backend("notebook")
pip3 install ipyevents
pip3 install pyvista

```

It is weird that the error was: try pip install pyvista (when it was already installed), what was missing was ipyevents.  
Now I have pyvista in mne.sys\_info() also, so it s all good now 😃  
Thank you !!
