# Modules not loading after installing some python libraries through the python console

**URL:** <https://discourse.slicer.org/t/modules-not-loading-after-installing-some-python-libraries-through-the-python-console/15787>\
**Category:** Support\
**Tags:** python\
**Created:** [February 2, 2021, 4:51am UTC](https://discourse.slicer.org/t/modules-not-loading-after-installing-some-python-libraries-through-the-python-console/15787 "2021-02-02T04:51:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atabak](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/atabak/32/7940_2.png) [@Atabak](https://discourse.slicer.org/u/Atabak)\
**Post date:** [February 2, 2021, 4:51am UTC](https://discourse.slicer.org/t/modules-not-loading-after-installing-some-python-libraries-through-the-python-console/15787/1 "2021-02-02T04:51:01Z")

</div>

Hi everyone,

I installed a couple of Python libraries (ctk, cv2,…) and my slicer stopped working like before after I restarted it. The errors that I get when I launch the software are the following:

> Traceback (most recent call last):  
> File “”, line 1, in   
> NameError: name ‘getSlicerRCFileName’ is not defined  
> Traceback (most recent call last):  
> File “”, line 1, in   
> File “C:\D\S4R\python-install\Lib\imp.py”, line 170, in load\_source  
> module = \_exec(spec, sys.modules[name])  
> File “”, line 618, in \_exec  
> File “”, line 678, in exec\_module  
> File “”, line 219, in \_call\_with\_frames\_removed  
> File “C:/D/S4R/Slicer-build/lib/Slicer-4.13/qt-scripted-modules/AddManyMarkupsFiducialTest.py”, line 5, in

Operating system:Windows10  
Slicer version:4.13.0

I would appreciate some help on this.  
Thanks,  
Atabak

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 2, 2021, 4:58am UTC](https://discourse.slicer.org/t/modules-not-loading-after-installing-some-python-libraries-through-the-python-console/15787/2 "2021-02-02T04:58:20Z")

</div>

We already use the ctk namespace for CTK ([https://commontk.org/](https://commontk.org/)). Fortunately, [ctk Python package](https://pypi.org/project/ctk/) does not seem to be a useful package, so you should just make sure that you or other packages don’t accidentally install it.

OpenCV is a huge collection of random stuff and there are many ways of making it out to be a Python package. It is entirely possible that some distributions can break Slicer.

If you find indispensable Python packages that seem to break Slicer then let us know and we can have a look.

---

<div class="post-metadata">

**Author:** ![Atabak](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/atabak/32/7940_2.png) [@Atabak](https://discourse.slicer.org/u/Atabak)\
**Post date:** [February 2, 2021, 5:41am UTC](https://discourse.slicer.org/t/modules-not-loading-after-installing-some-python-libraries-through-the-python-console/15787/3 "2021-02-02T05:41:10Z")

</div>

Hi Andras,

Thank you for your response. Here are the packages that I intended to install: “cv2, scipy, sitkUtils, SimpleITK, vtk, qt, ctk” . Some of them were already installed but some weren’t.

So how do I uninstall ctk Python package that I just installed?

I’m trying to use

> slicer.util.` `pip\_uninstall` ( _requirements_ )

But, I’m getting the following error:

> Traceback (most recent call last):  
> File “”, line 1, in   
> NameError: name ‘slicer’ is not defined

Thanks

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 2, 2021, 1:54pm UTC](https://discourse.slicer.org/t/modules-not-loading-after-installing-some-python-libraries-through-the-python-console/15787/4 "2021-02-02T13:54:46Z")

</div>

> [@Atabak](#):
>
> cv2, scipy, sitkUtils, SimpleITK, vtk, qt, ctk

These packages are already bundled with Slicer, do not try to reinstall them: scipy, sitkUtils, SimpleITK, vtk, qt, ctk (by the way, ctk is not a Python package from PyPI but a namespace where [CTK library](https://github.com/commontk/CTK) classes are imported into).

> [@Atabak](#):
>
> So how do I uninstall ctk Python package that I just installed?

If you cannot uninstall it using `pip_uninstall` then you probably need to delete the entire application folder and reinstall Slicer, extensions, and Python packages from scratch.

OpenCV is a huge beast, it can break anything, depending on which variant you import. Which OpenCV packages have you tried to install?

What are you trying to achieve? Run Python scripts without showing the application GUI?
