pyvmomi icon indicating copy to clipboard operation
pyvmomi copied to clipboard

module 'ssl' has no attribute 'wrap_socket'

Open thisispuneet opened this issue 1 year ago • 2 comments

Describe the bug

Getting following error on the first line from pyVmomi import vim

from pyVmomi import vim

File "/usr/lib/python3/dist-packages/pyVmomi/init.py", line 204, in

from pyVmomi.SoapAdapter import SoapStubAdapter, StubAdapterBase, SoapCmdStubAdapter, \

File "/usr/lib/python3/dist-packages/pyVmomi/SoapAdapter.py", line 993, in

_SocketWrapper = ssl.wrap_socket

                ^^^^^^^^^^^^^^^

AttributeError: module 'ssl' has no attribute 'wrap_socket'

As per GenAI: The error "module 'ssl' has no attribute 'wrap_socket'" indicates that the ssl.wrap_socket() function is being called in a Python environment where it has been removed. This function was deprecated in Python 3.7 and completely removed in later versions, such as Python 3.10 and above.

I'm have python version 3.12.3

Pyvmomi version 6.7.0.1-6

:/home/holuser# apt upgrade python3-pyvmomi

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

python3-pyvmomi is already the newest version (6.7.1-6).

Calculating upgrade... Done

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Is there a list of all pyvmomi dependencies?

Reproduction steps

1.from pyVmomi import vim 2. 3. ...

Expected behavior

How to solve this issue?

Additional context

No response

thisispuneet avatar Sep 21 '25 14:09 thisispuneet

This is really old:

https://github.com/vmware/pyvmomi/issues/1057

what version are you trying to use?

ekrichbaum avatar Sep 23 '25 02:09 ekrichbaum

Yes my bad just wasn't able to update the pyvmomi version as I had a locked down env. Bad ticket! closing now.

thisispuneet avatar Sep 29 '25 22:09 thisispuneet