Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

ImportError: attempted relative import with no known parent package #19

Closed
Unique-Wang opened this issue Aug 26, 2021 · 6 comments
Closed

Comments

@Unique-Wang
Copy link

Dear @ebranlard ,

It's me again ,when I was trying to use fast_input_file.py to read and write .fst files ,the error occurred,it's shown in the screenshot down below, I don't understand how to fix it,could you please help me with that?
Thank you in advance!
1629960340(1)

Best regards

@ebranlard
Copy link
Collaborator

Instead of calling the script directly, you can try importing it in stead within pyFAST. You can see some example syntax here for instance: https://github.com/OpenFAST/python-toolbox/blob/main/pyFAST/input_output/README.md

@Unique-Wang
Copy link
Author

Unique-Wang commented Aug 30, 2021

Dear @ebranlard

Thank you for your reply, that was a stupid mistake I made, and now I can use it to read and write .fst files, but when I tried to run the .fst files, this error occurred, it's shown in the screen shot, can you explain why ?
1630305841(1)

And here is my script
1630305769(1)

But no such error occurred when I use it to read and write .dat files .

Thank you in advance!

@Unique-Wang
Copy link
Author

Dear @ebranlard ,

Sorry for bothering you again, but it's been a few days after I asked you this question and I have tried so many times to fix it but didn't figure it out , so could you please tell me why the error occurred?

Best regards

@ebranlard
Copy link
Collaborator

ebranlard commented Sep 3, 2021

Dear @Unique-Wang,

I don't think this is a python-toolbox issue, it seems that some of your files are not found. One possible option is that you need to put your slashes in the other direction (it could be that openfast didn't detect that one of your path was absolute and it's trying to concatenate both. This could be why you see "D:" at the end of the file path).
I'd advise to start with a minimal working example, and with a shorter directory structure.

Instead of using the python-toolbox, you can try to edit your input files manually until they work, edit the paths one by one, starting from a model that already works.

I hope that helps!

@Unique-Wang
Copy link
Author

Sorry ,I just figured out what's wrong with my script and I was about to close this issue and then I saw your reply . Yes, it's definitely not an issue of your toolbox which is a masterpiece indeed . There's so much I need to learn about python ,so it's always much harder for me to right my mistakes than to make mistakes . Anyway ,thank you for your reply and have a good night!

@ebranlard
Copy link
Collaborator

No worries, I'm glad you solved it!

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

No branches or pull requests

2 participants