sethmlarson / virtualbox-python

Complete implementation of VirtualBox's COM API with a Pythonic interface.
https://pypi.org/project/virtualbox
Apache License 2.0
354 stars 75 forks source link

Unable to import library ("AttributeError: type object 'VBoxEventType' has no attribute 'progress_event'") #150

Closed nicl83 closed 4 years ago

nicl83 commented 4 years ago
ENVIRONMENT
SUMMARY

I'm no longer able to import the library following yesterday's update (2.1.0). Attempting to import the library, either in a program or in the Python interpreter on the command line, causes an error and the program terminates. (The interpreter does not terminate, but the library is not imported, and cannot be used.)

I have tried reinstalling VirtualBox both from source and from pip - no change. I have also tried reinstalling the VirtualBox API - again, no change.

STEPS TO REPRODUCE
  1. Start the Python interpreter. (Run python3 in your terminal of choice)
  2. Type import virtualbox and press enter.
  3. The error should occur.
EXPECTED RESULTS

The library is imported, and I am able to use VirtualBox-related functionality in my code.

ACTUAL RESULTS

An error occurs, and the library is not imported.

C:\Users\(username)\Downloads\virtualbox-python-master>python
Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import virtualbox
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\(username)\Downloads\virtualbox-python-master\virtualbox\__init__.py", line 26, in <module>
    from virtualbox.library_ext import library
  File "C:\Users\(username)\Downloads\virtualbox-python-master\virtualbox\library_ext\__init__.py", line 11, in <module>
    from virtualbox import library
  File "C:\Users\(username)\Downloads\virtualbox-python-master\virtualbox\library.py", line 36642, in <module>
    class IProgressEvent(IEvent):
  File "C:\Users\(username)\Downloads\virtualbox-python-master\virtualbox\library.py", line 36649, in IProgressEvent
    id = VBoxEventType.progress_event
AttributeError: type object 'VBoxEventType' has no attribute 'progress_event'
>>>
nicl83 commented 4 years ago

Rolling back to 2.0.0 (pip uninstall virtualbox followed by pip install -Iv virtualbox=2.0.0) does not resolve this issue, for some reason.

sethmlarson commented 4 years ago

Confirming that this is an issue specifically with the code generator, I'll get to it today.

sethmlarson commented 4 years ago

Fixed in 2.1.1