demergent-labs / kybra

Python CDK for the Internet Computer
MIT License
80 stars 15 forks source link

Following hello world tutorial results in deployment error #469

Closed fxgst closed 5 months ago

fxgst commented 5 months ago

When following the hello world tutorial in the kybra book, on dfx deploy, I get the following error:

dfx deploy
Deploying all canisters.
Creating canisters...
Creating canister kybra...
kybra canister created with canister id: be2us-64aaa-aaaaa-qaabq-cai
Building canisters...
Executing 'python -m kybra kybra src/main.py src/main.did'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/user/kybra/venv/lib/python3.12/site-packages/kybra/__main__.py", line 1, in <module>
    import modulegraph.modulegraph  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/kybra/venv/lib/python3.12/site-packages/modulegraph/modulegraph.py", line 12, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to build all canisters.
    Failed while trying to build all canisters.
      The build step failed for canister 'be2us-64aaa-aaaaa-qaabq-cai' (kybra) with an embedded error: Failed to build custom canister kybra.: Failed to run python -m kybra kybra src/main.py src/main.did.: The custom tool failed.

Using kybra 0.5.3

lastmjs commented 5 months ago

You're sure you've ran the following? And you're sure that the terminal you're deploying from has activated the correct virtual environment?

~/.pyenv/versions/3.10.7/bin/python -m venv venv
source venv/bin/activate

pip install kybra
fxgst commented 5 months ago

Tried again today with kybra 0.6.0 and it works