-
Notifications
You must be signed in to change notification settings - Fork 89
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
Specifed moudle not found: fitness.xxx #165
Comments
Can you run:
Notice we just use Also, to run this we have to be in the |
Yes I can run that. |
I also tried copying the file |
Yeah I just tried to copy the string match and changed the name and it works fine. I'll include my fitness function.
|
I removed my usage of function from the mybehaviours file and i could run my program. Is there any way I can import functions? |
Yes. If the module you want to import is installed system-wide it should work directly. If it's in the source tree, then at least it works if it's in the current directory. So, if I put this in
But if I put |
The function I want to access is in a file in a directory which is inside src. |
The code will run if I place a test file in src. |
This works:
Where
and I'm not very clever at Python sub-modules etc., but yes, it seems to be possible! |
I've been playing around with it and it seems to working now. |
The issue seems to persist if I'm importing in the file I'm importing. It seems to be a mess of python submodules |
My example above seems to show hot to import from within the import. So I believe this can be closed but please reopen if there is something specific not working. |
My fitness class is in src/fitness and has the same name as the file.
My grammar is in grammars.
And I'm running:
python3 ponyge.py --fitness_function xxx --grammar_file xxx.pybnf
Any help would be appreciated
The text was updated successfully, but these errors were encountered: