Skip to content
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

Open
nan0321 opened this issue Feb 21, 2023 · 5 comments
Open

Comments

@nan0321
Copy link

nan0321 commented Feb 21, 2023

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

@Rufaim
Copy link
Owner

Rufaim commented Feb 21, 2023

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,

@nan0321
Copy link
Author

nan0321 commented Feb 24, 2023 via email

@Rufaim
Copy link
Owner

Rufaim commented Feb 24, 2023

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.
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 for some reason, change

...
from .layers import EGCUH
...

to

...
from layers import EGCUH
...

@nan0321
Copy link
Author

nan0321 commented Feb 25, 2023 via email

@Bloodymoom
Copy link

Bloodymoom commented Apr 21, 2023

Hello,

Thank you for sharing this code.When I run the file train_gcn.py,There is an error in the picture below, could you please take the time to check the problem?

image

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants