ModuleNotFoundError: No module named '_ssl'

Hello,

Goal: I’m trying to implement websockets in trame application using paraview as a rendering engine. To implement websockets in trame app, i’m using asyncio to create tasks and execute parallelly. Trame app should act like a listener for websockets connections.

Error:
when I try to execute the application with the following command:
pvpython SimpleCone.py --server it gives me the error that ModuleNotFoundError: No module named ‘_ssl’ .

Detailed Error:
(pvenv) C:\Users\Ans.Shakeel\trame-app\trame-tutorial\05_paraview> pvpython SimpleCone.py --server
ParaView is using venv: C:\Users\Ans.Shakeel\visualizer-new version\vis_3\paraview-visualizer\pvenv
Traceback (most recent call last):
File “C:\Users\Ans.Shakeel\trame-app\trame-tutorial\05_paraview\SimpleCone.py”, line 4, in
import _ssl
ModuleNotFoundError: No module named ‘_ssl’

Note: It is working perfectly fine with VTK as rendering engine. According to my understanding, it’s issue in pvpython interpreter. I also tried to import ssl in python shell, the error is following:
(venv) C:\Users\Ans.Shakeel\trame-app\trame-tutorial\05_paraview>pvpython
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

import _ssl
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘_ssl’
import ssl
Traceback (most recent call last):
File “”, line 1, in
File “C:\Program Files\ParaView 5.11.0\bin\lib\ssl.py”, line 99, in
import _ssl # if we can’t import it, let the error propagate
ModuleNotFoundError: No module named ‘_ssl’
import sys
print(sys.path)
[‘’, ‘C:\Program Files\ParaView 5.11.0\bin\Lib\site-packages’, ‘C:\Program Files\ParaView 5.11.0\bin\python39.zip’, ‘C:\Program Files\ParaView 5.11.0\bin\DLLs’, ‘C:\Program Files\ParaView 5.11.0\bin\lib’, ‘C:\Program Files\ParaView 5.11.0\bin’, ‘C:\Program Files\ParaView 5.11.0\bin\lib\site-packages’, ‘C:\Program Files\ParaView 5.11.0\bin\lib\site-packages\win32’, ‘C:\Program Files\ParaView 5.11.0\bin\lib\site-packages\win32\lib’, ‘C:\Program Files\ParaView 5.11.0\bin\lib\site-packages\Pythonwin’]

Regards,
Ans

The Python that get bundled inside ParaView does not include SSL as it will always be out of sync security wise after weeks of release.

If you build ParaView from the superbuild, you can turn ON ssl. We sometime do it as one-off on our CI when we need such binary.

In general, it is better and easier to put a trame app behind a apache/nginx to use https/wss.

HTH,

Seb

Hi seb, Thanks for your quick answer.

I tried to build ParaView Superbuild to enable SSL so that I can use Web Sockets in Trame application using Paraview behind it. Right now the version v5.11.1 RC1 is causing pipeline failed so I tried with v5.11.0 . I successfully installed the ParaView-superbuild with SSL Enabled and also enabled all python modules.

Now when I try to run the Trame application using the pvpython of ParaView-superbuild it is giving me following error: Paraview is not available

as a result the UI of the trame app is showing but the render view of paraview is not showing. The image is attached below:


Note: For testing I’m running a simple paraview based Time Animation example from trame examples.

According to my understanding, I missed some important flag while building Paraview-superbuild. If that’s the case, please guide me in the following matter.

Regards,
Ans

Hello, after rebuilding the paraview super-build multiple times with different flags I finally found the issue. The issue was related to numpy. Enabling USE_SYSTEM_numpy resolves the problem.

Thanks

1 Like