-
Notifications
You must be signed in to change notification settings - Fork 7
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
ImportError: attempted relative import with no known parent package #2
Comments
Hi, It may happen when you trying to run a file from a module with a terminal rooted inside module folder. |
Hello,
I appreciate your response. I am running python 3.11 using Spyder. I am
working on a project related to the elliptic dataset. Hence, I am trying to
run the EvolveGCN code. I tried various solutions online but still faced
the same error. Do you have any advice on how I can run the code and in
which order? Any help would be appreciated.
Thank you
Regards,
Nano Lee
…On Tue, Feb 21, 2023 at 11:19 PM Pavel Rumiantsev ***@***.***> wrote:
Hi, It may happen when you trying to run a file from a module with a
terminal rooted inside module folder.
Can you provide more details of what are you trying to do and your python
version?
For the description above it looks more like you are using python wrong
rather than any issues with the code,
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A5XOUQXCZ7LBR7BIIBZKXRTWYUIN7ANCNFSM6AAAAAAVC6AFRY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Thank you for interest in my work. ...
from .layers import EGCUH
... to ...
from layers import EGCUH
... |
I will try that, thank you very much.
…On Sat, Feb 25, 2023 at 1:44 AM Pavel Rumiantsev ***@***.***> wrote:
Thank you for interest in my work.
I can advise to *first* fix a working folder to a root folder of
EvolveGCN project.
You can do it by making a run config
<https://docs.spyder-ide.org/current/panes/editor.html#run-configuration>.
If it is not helping, *second*, check python release notes for any
updates on import, because this project has not been tested on anything
above python 3.8.
*Third*, do not run files containing relative imports. Make new scripts
instead and import that module. If you decide that a bad idea to run such
file is the best option you have and you absolutely have to, then replace
all relative imports with absolute ones.
For example, if you have a need to run evolve_gcn.py
<https://github.com/Rufaim/EvolveGCN/blob/master/models/evolve_gcn.py>
for some reason, change
...from .layers import EGCUH
...
to
...from layers import EGCUH
...
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A5XOUQW7F2JO7WR6433VYOLWZETUJANCNFSM6AAAAAAVC6AFRY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hello,
Thank you for sharing this code. Some files like the training files are running successfully. However other folders give an error like the following "ImportError: attempted relative import with no known parent package". Any idea on how we can run the code with out these errors? Any recommendation is appreciated!
Thank you
The text was updated successfully, but these errors were encountered: