Open bw-xu opened 1 year ago
Will be fixed in next release, but for now you can set the CODON_PATH
environment variable to the standard library path (~/.codon/lib/codon/stdlib
by default). For example, for me it would be:
export CODON_PATH=/Users/arshajii/.codon/lib/codon/stdlib
Thanks for replying! I tried that, and it seemed to work. However, another error occurs in line 13 (def is_prime_codon(n):
)
Exception has occurred: UnicodeEncodeError 'ascii' codec can't encode characters in position 26-27: ordinal not in range(128)
Thanks for replying! I tried that, and it seemed to work. However, another error occurs in line 13 (
def is_prime_codon(n):
)Exception has occurred: UnicodeEncodeError 'ascii' codec can't encode characters in position 26-27: ordinal not in range(128)
This is the full traceback info:
Traceback (most recent call last): File "/Users/bowenxu/Codes/Codon学习/foo1.py", line 12, in
@codon.jit ^^^^^^^^^ File "/opt/homebrew/Caskroom/miniforge/base/envs/Crypto/lib/python3.11/site-packages/codon/decorator.py", line 217, in jit return _decorate(fn) ^^^^^^^^^^^^^ File "/opt/homebrew/Caskroom/miniforge/base/envs/Crypto/lib/python3.11/site-packages/codon/decorator.py", line 187, in _decorate _jit.execute( File "codon/jit.pyx", line 27, in codon.codon_jit.JITWrapper.execute File "stringsource", line 15, in string.from_py.__pyx_convert_string_from_py_std__in_string UnicodeEncodeError: 'ascii' codec can't encode characters in position 26-27: ordinal not in range(128)
OH, I know the reason. This is because my path to the source file contains Unicode characters. If there aren't such characters, the solution above works.
@bw-xu Thanks for the report. Will see if we can handle this.
@bw-xu Thanks for the report. Will see if we can handle this.
Let's see.
Also, I wonder if there is any guide for developer who would like to contribute to this project.
I feel like codon is a fancy project, and I hope to fix bugs and improve it if I could.
Environment
MacOS 13.1, Python 3.8.3/3.11.0, codon 0.15, codon-jit
Description
After I installed
codon
via/bin/bash -c "$(curl -fsSL https://exaloop.io/install.sh)"
, I can run.py
file correctly viacodon run -release fib.py
. However, when I tried the python decorator, it saysThe code I ran is