smartcontractkit / full-blockchain-solidity-course-py

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
MIT License
10.81k stars 2.91k forks source link

Lesson 7: No module named '_dbus_bindings' #1400

Open blackyinsol opened 2 years ago

blackyinsol commented 2 years ago

I am having an issue when I try to run the "test_get_entrance_fee".

The error massage is:

=============================================== ERRORS ================================================
_____________________________ ERROR collecting tests/test_lottery_unit.py _____________________________
ImportError while importing test module '/home/albert/demos/smartcontract-lottery/tests/test_lottery_unit.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_lottery_unit.py:2: in <module>
    from scripts.deploy_lottery import deploy_lottery
scripts/deploy_lottery.py:1: in <module>
    from scripts.helpful_scripts import get_account, get_contract, fund_with_link
scripts/helpful_scripts.py:4: in <module>
    from dbus import Interface
/usr/lib/python3/dist-packages/dbus/__init__.py:73: in <module>
    import dbus.types as types
/usr/lib/python3/dist-packages/dbus/types.py:8: in <module>
    from _dbus_bindings import (
**E   ModuleNotFoundError: No module named '_dbus_bindings'**

I am running Visual Studio Code under Ubuntu 20.04.4 LTS Is there someone having the same issue?

cromewar commented 2 years ago

Hello @blackyinsol It seems you have an extra import: from dbus import Interface may be the auto completer put this for you, but you don't need this line give it a try.