Chia-Network / chia-blockchain

Chia blockchain python implementation (full node, farmer, harvester, timelord, and wallet)
Apache License 2.0
10.82k stars 2.03k forks source link

Problem to import 'deserialize_and_run_program2' from 'clvm_rs' #7600

Closed kalufinnle closed 3 years ago

kalufinnle commented 3 years ago

Ubuntu 20 LTS when run Chia init. There is a python import error:

ImportError: cannot import name 'deserialize_and_run_program2' from 'clvm_rs' (/chia-blockchain/venv/lib/python3.8/site-packages/clvm_rs.cpython-38-x86_64-linux-gnu.so)

kalufinnle commented 3 years ago

reinstalled clvm==0.9.6 does not fix the issue

kalufinnle commented 3 years ago

clvm_rs github repo is outdated. The version from clvm_rs is incompatible with clvm==0.9.6, which is required by Chia

kalufinnle commented 3 years ago

Update history of errors. Ubuntu 20.04 LTS: File "/Downloads/chia-blockchain/venv/bin/chia", line 33, in sys.exit(load_entry_point('chia-blockchain', 'console_scripts', 'chia')()) File "/Downloads/chia-blockchain/chia/cmds/chia.py", line 79, in main cli() # pylint: disable=no-value-for-parameter File "/Downloads/chia-blockchain/venv/lib/python3.8/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/Downloads/chia-blockchain/venv/lib/python3.8/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/Downloads/chia-blockchain/venv/lib/python3.8/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Downloads/chia-blockchain/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/Downloads/chia-blockchain/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke return callback(args, *kwargs) File "/Downloads/chia-blockchain/venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func return f(get_current_context(), args, **kwargs) File "/Downloads/chia-blockchain/chia/cmds/init.py", line 27, in init_cmd from .init_funcs import init File "/Downloads/chia-blockchain/chia/cmds/init_funcs.py", line 9, in from chia.consensus.coinbase import create_puzzlehash_for_pk File "/Downloads/chia-blockchain/chia/consensus/coinbase.py", line 3, in from chia.types.blockchain_format.coin import Coin File "/Downloads/chia-blockchain/chia/types/blockchain_format/coin.py", line 8, in from chia.util.streamable import Streamable, streamable File "/Downloads/chia-blockchain/chia/util/streamable.py", line 14, in from chia.types.blockchain_format.program import Program, SerializedProgram File "/Downloads/chia-blockchain/chia/types/blockchain_format/program.py", line 10, in from clvm_rs import STRICT_MODE, deserialize_and_run_program2, serialized_length ImportError: cannot import name 'deserialize_and_run_program2' from 'clvm_rs' (/Downloads/chia-blockchain/venv/lib/python3.8/site-packages/clvm_rs.cpython-38-x86_64-linux-gnu.so)

rixon commented 3 years ago

I have this same problem, when trying to update from 1.6 to the latest, following the update instructions on the wiki, and using Ubuntu 20.04 LTS.

kalufinnle commented 3 years ago

Are you able to launch Chia GUI? I cannot after the update.

On Sun, Jul 18, 2021 at 12:01 Paul Kenyon @.***> wrote:

I have this same problem, when trying to update from 1.6 to the latest, following the update instructions on the wiki.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Chia-Network/chia-blockchain/issues/7600#issuecomment-882079140, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFVBW3OQ3UQ3CCPZT7QVL23TYL3GTANCNFSM5ARKPG7A .

rixon commented 3 years ago

I don't run the GUI, but this makes sense. The GUI uses the main chia codebase underneath, so if it can't run, neither will the GUI.

kalufinnle commented 3 years ago

Yep. GUI codes are intact and fully functional. When it calls the Chia core, things not run

On Sun, Jul 18, 2021 at 13:08 Paul Kenyon @.***> wrote:

I don't run the GUI, but this makes sense. The GUI uses the main chia codebase underneath, so if it can't run, neither will the GUI.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Chia-Network/chia-blockchain/issues/7600#issuecomment-882088421, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFVBW3NHSOJH5KIGXXYUO43TYMDCRANCNFSM5ARKPG7A .

emlowe commented 3 years ago

Are you running the install script again? - try running sh install.sh again. Also make sure to deactivate and . ./activate

kalufinnle commented 3 years ago

Tried it again. Nope. I think the error has nothing to do with the install.sh. It is a python library problem arised from the chia clvm_rs library.

On Sun, Jul 18, 2021 at 15:21 Earle Lowe @.***> wrote:

Are you running the install script again? - try running sh install.sh again. Also make sure to deactivate and . ./activate

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Chia-Network/chia-blockchain/issues/7600#issuecomment-882105150, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFVBW3MDBIFMUK3P4IFXJCDTYMSR3ANCNFSM5ARKPG7A .

emlowe commented 3 years ago

The install.sh command should install that latest clvm_rs python wheel - which is 0.1.8. What version of clvm_rs do you have? run . .\activate; pip list | grep clvm

kalufinnle commented 3 years ago

Hm. The install.sh installed the 0.1.7 version of clvm-rs(it is written by the chia team) which is rely on an old version of clvm (question for @richardkiss @arvidn, can you confirm the version of clvm-rs that the current mainbranch of chia-blockchain calling). My clvm version is 0.9.6. I tried to downgrade it to the one clvm-rs called. Still doesn't work. Would be a good idea if we don't use rust?

My current clvm version: clvm 0.9.6 clvm-rs 0.1.7 clvm-tools 0.4.3

I also manually installed clvm_rs from the following link https://github.com/Chia-Network/clvm_rs It is very weird .. installed rust and cargpo but somehow cargo is not working. I think it has something to do with either rust or cargo or the clvm version

Would be great if there is a way to check the compatibility between rust, cargo and clvm

On Sun, Jul 18, 2021 at 20:06 Earle Lowe @.***> wrote:

The install.sh command should install that latest clvm_rs python wheel - which is 0.1.8. What version of clvm_rs do you have? run . .\activate; pip list | grep clvm

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Chia-Network/chia-blockchain/issues/7600#issuecomment-882138416, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFVBW3K4C7N4TZP7LTYDPHDTYNT7BANCNFSM5ARKPG7A .

arvidn commented 3 years ago

The install.sh installed the 0.1.7 version of clvm-rs(it is written by the chia team) which is rely on an old version of clvm

"really old" may be an exaggeration. It's just one version behind the most recent release, 0.1.8. Still, you need the 0.1.8 version for deserialize_and_run_program2.

If you're not getting a module that's compatible with your version of chia, you may be mixing and matching versions by accident. Make sure you're running chia from the same commit of chia-blockchain as you run install.sh from. Sometimes it might be easiest to remove the venv and just create a fresh one, to ensure all the modules are compatible.

emlowe commented 3 years ago

Closing issue