OpShin / opshin

A simple pythonic programming language for Smart Contracts on Cardano
https://book.opshin.dev/
MIT License
143 stars 28 forks source link

Run opshin command error #377

Closed DreamHackchosenone closed 5 months ago

DreamHackchosenone commented 5 months ago

Describe the bug opshin command error

To Reproduce Steps to reproduce the behavior:

  1. opshin 2.opshin Traceback (most recent call last): File "/Users/admin/.conda/envs/py3.9/bin/opshin", line 5, in from opshin.main import main File "/Users/admin/.conda/envs/py3.9/lib/python3.9/site-packages/opshin/init.py", line 17, in from .compiler import File "/Users/admin/.conda/envs/py3.9/lib/python3.9/site-packages/opshin/compiler.py", line 3, in from uplc.ast import data_from_cbor File "/Users/admin/.conda/envs/py3.9/lib/python3.9/site-packages/uplc/init.py", line 16, in from .tools import parse, eval, dumps, UPLCDialect, flatten, unflatten File "/Users/admin/.conda/envs/py3.9/lib/python3.9/site-packages/uplc/tools.py", line 5, in from .parser import Parser File "/Users/admin/.conda/envs/py3.9/lib/python3.9/site-packages/uplc/parser.py", line 6, in from . import lexer, ast File "/Users/admin/.conda/envs/py3.9/lib/python3.9/site-packages/uplc/ast.py", line 21, in import pysecp256k1 File "/Users/admin/.conda/envs/py3.9/lib/python3.9/site-packages/pysecp256k1/init.py", line 4, in from pysecp256k1.low_level import ( File "/Users/admin/.conda/envs/py3.9/lib/python3.9/site-packages/pysecp256k1/low_level/init.py", line 1, in from pysecp256k1.low_level.secp256k1 import File "/Users/admin/.conda/envs/py3.9/lib/python3.9/site-packages/pysecp256k1/low_level/secp256k1.py", line 500, in lib = load_secp256k1_library(find_pysecp_env_var()) File "/Users/admin/.conda/envs/py3.9/lib/python3.9/site-packages/pysecp256k1/low_level/secp256k1.py", line 495, in load_secp256k1_library _add_function_definitions(handle) File "/Users/admin/.conda/envs/py3.9/lib/python3.9/site-packages/pysecp256k1/low_level/secp256k1.py", line 139, in _add_function_definitions _secp256k1.secp256k1_ec_pubkey_cmp.restype = ctypes.c_int File "/Users/admin/.conda/envs/py3.9/lib/python3.9/ctypes/init.py", line 387, in getattr func = self.getitem(name) File "/Users/admin/.conda/envs/py3.9/lib/python3.9/ctypes/init.py", line 392, in getitem func = self._FuncPtr((name_or_ordinal, self)) AttributeError: dlsym(0x3092b6d90, secp256k1_ec_pubkey_cmp): symbol not found

OS: Mac M1 python3.9 pycardano 0.10.0 opshin 0.21.1

nielstron commented 5 months ago

Seems like an issue with secp256k1 on MacOS. Did you install secp256k1 (as described in https://github.com/OpShin/uplc?tab=readme-ov-file#secp256k1)? Maybe try a different python version or not using conda?

DreamHackchosenone commented 5 months ago

Yeah, after i reinstall secp256k1(https://github.com/bitcoin-core/secp256k1) opshin worked,Thank you!