starkware-libs / cairo-lang

Apache License 2.0
1.34k stars 263 forks source link

After installing pip install cairo lang, execute the starknit version and the error message is as follows. Please help to answer the question #165

Open LXHLeaner opened 1 year ago

LXHLeaner commented 1 year ago

lc@LCdeMacBook-Pro ~ % starknet version Traceback (most recent call last): File "/opt/homebrew/bin/starknet", line 8, in from starkware.starknet.cli.starknet_cli import main # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/starkware/starknet/cli/starknet_cli.py", line 18, in from starkware.starknet.cli.starknet_cli_utils import ( File "/opt/homebrew/lib/python3.11/site-packages/starkware/starknet/cli/starknet_cli_utils.py", line 25, in from starkware.starknet.services.api.feeder_gateway.feeder_gateway_client import ( File "/opt/homebrew/lib/python3.11/site-packages/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py", line 7, in from starkware.starknet.services.api.feeder_gateway.request_objects import ( File "/opt/homebrew/lib/python3.11/site-packages/starkware/starknet/services/api/feeder_gateway/request_objects.py", line 6, in from starkware.starknet.business_logic.execution.execute_entry_point import ExecuteEntryPoint File "/opt/homebrew/lib/python3.11/site-packages/starkware/starknet/business_logic/execution/execute_entry_point.py", line 9, in from starkware.cairo.common.cairo_function_runner import CairoFunctionRunner File "/opt/homebrew/lib/python3.11/site-packages/starkware/cairo/common/cairo_function_runner.py", line 21, in from starkware.cairo.lang.vm.cairo_runner import CairoRunner, process_ecdsa, verify_ecdsa_sig File "/opt/homebrew/lib/python3.11/site-packages/starkware/cairo/lang/vm/cairo_runner.py", line 35, in from starkware.cairo.lang.instances import DYNAMIC_LAYOUT_NAME, LAYOUTS, CairoLayout File "/opt/homebrew/lib/python3.11/site-packages/starkware/cairo/lang/instances.py", line 64, in @dataclasses.dataclass ^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 1230, in dataclass return wrap(cls) ^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 1220, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 958, in _process_class cls_fields.append(_get_field(cls, name, type, kw_only)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 815, in _get_field raise ValueError(f'mutable default {type(f.default)} for field ' ValueError: mutable default <class 'starkware.cairo.lang.instances.CpuInstanceDef'> for field cpu_instance_def is not allowed: use default_factory

cymqqqq commented 1 year ago

same error, someone can fix this?

cymqqqq commented 1 year ago

Hi there again, I tried python3.9 and python.3.11, and it prints different errors, finally, I tried python3.10 and it works! Anyone who meets this error can follow my steps here:

  1. brew install python3.10
  2. alias python=python3.10
  3. python -m pip install ecdsa sympy
  4. CFLAGS=-I/usr/local/Cellar/gmp/6.2.1_1/include LDFLAGS=-L/usr/local/Cellar/gmp/6.2.1_1/lib python -m pip install fastecdsa (for silicon mac user)
  5. python -m pip cairo-lang
  6. starknet --version
onemapl3 commented 1 year ago

Hi there again, I tried python3.9 and python.3.11, and it prints different errors, finally, I tried python3.10 and it works! Anyone who meets this error can follow my steps here:

  1. brew install python3.10
  2. alias python=python3.10
  3. python -m pip install ecdsa sympy
  4. CFLAGS=-I/usr/local/Cellar/gmp/6.2.1_1/include LDFLAGS=-L/usr/local/Cellar/gmp/6.2.1_1/lib python -m pip install fastecdsa (for silicon mac user)
  5. python -m pip cairo-lang
  6. starknet --version

I got this message when doing the 5th step ERROR: unknown command "cairo-lang" I checked my pip is the latest version 23.2.1 can anyone solve this?