-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'PyError: invalid syntax' error when running python compiled code #447
Comments
@aresper Why are you importing: from python import graph_0_0_test.JobGraph
from python import graph_0_0_test.IntervalGraph
from python import aux_0_0.ComputeJobs Did you install If it exists in the same directory as main_0_0_test.py, you can import it: from .graph_0_0_test import JobGraph
from .graph_0_0_test import IntervalGraph
from .aux_0_0 import ComputeJobs |
Hello @elisbyberi, To import my python modules I used the procedure described here: If I use the import statement as suggested I get the following compilation error:
|
@aresper Be sure the PYTHONPATH environment variable includes the path of mymodule.py! Use The error @python
def from_py():
from dataclasses import dataclass
@dataclass
class T:
a = 1
def method(self):
print(self.a + 4)
return T()
t = from_py()
print(t.a) # 1
t.method() # 5 The equivalent in Codon would be: @tuple
class T:
a = 1
def method(self):
print(self.a + 6)
t = T()
print(t.a) # 1
t.method() # 7 |
Hello @elisbyberi,
The initial part of my files currently look like this: Any ideas? |
I can successfully compile my python code, but when I try to run the binary I get the following error:
Since the code compiles, I was not expecting to get syntax error during execution.
Here are the snippets of the code I am trying to run:
This is the code from file main_0_0_test.py:
And this is the code from file graph_0_0_test.py, where I am getting the error in line 8 in the import statement:
And this is the code for file vertex_0_0_test.py:
The text was updated successfully, but these errors were encountered: