# Unable to initialize Python in ver 6.4 and 6.5(dev)

**URL:** <https://shapeworks.discourse.group/t/unable-to-initialize-python-in-ver-6-4-and-6-5-dev/161>\
**Category:** Uncategorized\
**Created:** [June 30, 2023, 1:34am UTC](https://shapeworks.discourse.group/t/unable-to-initialize-python-in-ver-6-4-and-6-5-dev/161 "2023-06-30T01:34:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yuyoung](https://avatars.discourse-cdn.com/v4/letter/y/eada6e/32.png) [@Yuyoung](https://shapeworks.discourse.group/u/Yuyoung)\
**Post date:** [June 30, 2023, 1:34am UTC](https://shapeworks.discourse.group/t/unable-to-initialize-python-in-ver-6-4-and-6-5-dev/161/1 "2023-06-30T01:34:06Z")

</div>

Hello, I am currently working with human mandible with ShapeWorks but I have some problem on version 6.4 and 6.5 (dev).

I didn’t know that there was a new release so I’ve tried to install the new version and the dev version on my computer based on the [installation guideline](http://sciinstitute.github.io/ShapeWorks/latest/users/install.html). However, I constantly meet two error messages below (it is written in Korean - “cannot find designated module”)

 ![](https://global.discourse-cdn.com/free1/uploads/shapeworks/original/1X/fc4ccd82ed357f88454a237499c6efb4717bd250.png)  
 **![](https://global.discourse-cdn.com/free1/uploads/shapeworks/original/1X/8d2371887fc5df13527e6c1f1cc6100f6e130eb7.png)**

I saw in release note of 6.3 that python error problem is solved already, but I don’t know why I am confronting this problem. I’ve already tried to uninstall all the problem and redo the process but still I am seeing those error. Is there any way I could solve this problem?

Thank you.

---

<div class="post-metadata">

**Author:** ![Yuyoung](https://avatars.discourse-cdn.com/v4/letter/y/eada6e/32.png) [@Yuyoung](https://shapeworks.discourse.group/u/Yuyoung)\
**Post date:** [June 30, 2023, 1:35am UTC](https://shapeworks.discourse.group/t/unable-to-initialize-python-in-ver-6-4-and-6-5-dev/161/2 "2023-06-30T01:35:05Z")

</div>

The photo is so small so I copy and paste the error message.

1. 

Error: Unable to initialize Python: ImportError: DLL load failed while importing vtkViewsInfovis: 지정된 모듈을 찾을 수 없습니다. At: C:\Users\Admin.conda\envs\shapeworks64\lib\site-packages\vtkmodules\all.py(21): (228): \_call\_with\_frames\_removed (850): exec\_module (695): \_load\_unlocked (986): \_find\_and\_load\_unlocked (1007): \_find\_and\_load (1030): _gcd\_import C:\Users\Admin.conda\envs\shapeworks64\lib\importlib\_init_.py(127): import\_module C:\Users\Admin.conda\envs\shapeworks64\lib\site-packages\vtk.py(31): (228): \_call\_with\_frames\_removed (850): exec\_module (695): \_load\_unlocked (986): \_find\_and\_load\_unlocked (1007): _find\_and\_load C:\Users\Admin.conda\envs\shapeworks64\lib\site-packages\shapeworks\_init_.py(1): (228): \_call\_with\_frames\_removed (850): exec\_module (695): \_load\_unlocked (986): \_find\_and\_load\_unlocked (1007): \_find\_and\_load (228): \_call\_with\_frames\_removed (972): \_find\_and\_load\_unlocked (1007): \_find\_and\_load

1. 

Error: Unable to initialize Python. Please run install\_shapeworks.bat

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [June 30, 2023, 4:04pm UTC](https://shapeworks.discourse.group/t/unable-to-initialize-python-in-ver-6-4-and-6-5-dev/161/3 "2023-06-30T16:04:29Z")

</div>

Hi,

Can you check if you are able to import the shapeworks python module from within python via the anaconda prompt?

1. Open the anaconda command prompt
2. run “conda activate shapeworks” (check that this works)
3. run “python”
4. In python, “import shapeworks” (check that this works)

---

<div class="post-metadata">

**Author:** ![Yuyoung](https://avatars.discourse-cdn.com/v4/letter/y/eada6e/32.png) [@Yuyoung](https://shapeworks.discourse.group/u/Yuyoung)\
**Post date:** [July 3, 2023, 12:24am UTC](https://shapeworks.discourse.group/t/unable-to-initialize-python-in-ver-6-4-and-6-5-dev/161/4 "2023-07-03T00:24:42Z")

</div>

Hi, thank you for your reply.

 ![image](https://global.discourse-cdn.com/free1/uploads/shapeworks/original/1X/e43589232241d14327ecad9ef400e797c995a2f0.png)

 ![image](https://global.discourse-cdn.com/free1/uploads/shapeworks/original/1X/900f1487656b26f7781048e58b3624de9697a9fd.png)

If I import shapeworks in anaconda command prompt, the error message like below appears.

```auto
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Admin\.conda\envs\shapeworks\lib\site-packages\shapeworks\ __init__.py", line 1, in <module>
    import vtk
  File "C:\Users\Admin\.conda\envs\shapeworks\lib\site-packages\vtk.py", line 31, in <module>
    all_m = importlib.import_module('vtkmodules.all')
  File "C:\Users\Admin\.conda\envs\shapeworks\lib\importlib\ __init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\Admin\.conda\envs\shapeworks\lib\site-packages\vtkmodules\all.py", line 21, in <module>
    from .vtkViewsInfovis import *
ImportError: DLL load failed while importing vtkViewsInfovis: 지정된 모듈을 찾을 수 없습니다.

```

The last sentence is written in Korean and it could be translated as “could not find the designated module”

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [July 27, 2023, 2:49pm UTC](https://shapeworks.discourse.group/t/unable-to-initialize-python-in-ver-6-4-and-6-5-dev/161/5 "2023-07-27T14:49:27Z")

</div>

This seems to be a problem with some changes that happened with Conda. Could you please try either the 6.4.2 release or the latest dev release?

> **[Release ShapeWorks v6.4.2 · SCIInstitute/ShapeWorks](https://github.com/SCIInstitute/ShapeWorks/releases/tag/v6.4.2)**
>
> See ShapeWorks 6.4.2 Release Notes

> **[Release Development Build for Windows · SCIInstitute/ShapeWorks](https://github.com/SCIInstitute/ShapeWorks/releases/tag/dev-windows)**
>
> Commits
> 
> 4e0cd8e: Switch to eigen matrix for inverse covariance matrix to fix #2117 (Alan Morris) #2118

---

<div class="post-metadata">

**Author:** ![M.R](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@M.R](https://shapeworks.discourse.group/u/M.R)\
**Post date:** [May 18, 2024, 5:11am UTC](https://shapeworks.discourse.group/t/unable-to-initialize-python-in-ver-6-4-and-6-5-dev/161/6 "2024-05-18T05:11:15Z")

</div>

Hi,  
I think I have the same problem.  
Until today, I used the previous version of ShapeWorks and I had no problem using the ShapeWorks library. Now, I have installed its new version, version 6.5, and when importing the library in Python, I get the error No module named ‘shapeworks’. What is the problem?  
I do the installation steps according to the following site.

> **[How to Install ShapeWorks? - ShapeWorks](http://sciinstitute.github.io/ShapeWorks/latest/users/install.html)**
>
> The official documentation of ShapeWorks

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [May 27, 2024, 2:39pm UTC](https://shapeworks.discourse.group/t/unable-to-initialize-python-in-ver-6-4-and-6-5-dev/161/7 "2024-05-27T14:39:10Z")

</div>

Is this on Windows, Mac, or Linux?

Can you check the output of the `install_shapeworks` step and see if there were any errors? With the conda environment loaded, does the following work?

```auto
$ python
import shapeworks

```

---

<div class="post-metadata">

**Author:** ![Windy](https://avatars.discourse-cdn.com/v4/letter/w/91b2a8/32.png) [@Windy](https://shapeworks.discourse.group/u/Windy)\
**Post date:** [April 26, 2025, 4:04am UTC](https://shapeworks.discourse.group/t/unable-to-initialize-python-in-ver-6-4-and-6-5-dev/161/8 "2025-04-26T04:04:07Z")

</div>

![image](https://global.discourse-cdn.com/free1/uploads/shapeworks/original/1X/93861d36d709774255c362f716150cc14c764b9a.png)  
I am getting this error when try to import shapeworks. When I downgrade the `type_extensions` package to `4.13.2` I end up getting below error:

```auto
>>> import shapeworks
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sabe848/miniconda3/envs/shapeworks/lib/python3.9/site-packages/shapeworks/ __init__.py", line 13, in <module>
    from .portal import download_dataset
  File "/home/sabe848/miniconda3/envs/shapeworks/lib/python3.9/site-packages/shapeworks/portal.py", line 16, in <module>
    from swcc.models import Dataset
  File "/home/sabe848/miniconda3/envs/shapeworks/lib/python3.9/site-packages/swcc/models/ __init__.py", line 2, in <module>
    from .other_models import (
  File "/home/sabe848/miniconda3/envs/shapeworks/lib/python3.9/site-packages/swcc/models/other_models.py", line 19, in <module>
    class Segmentation(ApiModel):
  File "pydantic/main.py", line 197, in pydantic.main.ModelMetaclass. __new__
  File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer
  File "pydantic/fields.py", line 436, in pydantic.fields.ModelField. __init__
  File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare
  File "pydantic/fields.py", line 751, in pydantic.fields.ModelField._type_analysis
  File "pydantic/fields.py", line 808, in pydantic.fields.ModelField._create_sub_type
  File "pydantic/fields.py", line 436, in pydantic.fields.ModelField. __init__
  File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare
  File "pydantic/fields.py", line 668, in pydantic.fields.ModelField._type_analysis
  File "/home/sabe848/miniconda3/envs/shapeworks/lib/python3.9/typing.py", line 852, in __subclasscheck__
    return issubclass(cls, self. __origin__ )
TypeError: issubclass() arg 1 must be a class

```

Any advice on fixing this? I am using Shapeworks 6.5.1 on Linux (ubuntu 24.04)

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [May 6, 2025, 7:24pm UTC](https://shapeworks.discourse.group/t/unable-to-initialize-python-in-ver-6-4-and-6-5-dev/161/9 "2025-05-06T19:24:00Z")

</div>

Can you try installing a different version of pydantic?

`pip install pydantic==1.10.13`

or

`pip install pydantic==2.7.0`
