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

Error when running delete_autogenerated_files.py #54

Closed
shirgoldbird opened this issue Aug 30, 2021 · 1 comment
Closed

Error when running delete_autogenerated_files.py #54

shirgoldbird opened this issue Aug 30, 2021 · 1 comment

Comments

@shirgoldbird
Copy link

I get an error when running python src/scripts/delete_autogenerated_files.py:

Traceback (most recent call last):
  File "/Users/shirgoldberg/Documents/lastresortbeta/src/scripts/delete_autogenerated_files.py", line 1, in <module>
    from src.scripts.build_site import delete_output_file_space
ModuleNotFoundError: No module named 'src'

I believe this is because the src folder isn't added to my Python path. I fixed the problem by adding this to the top of delete_autogenerated_files.py:

import sys
sys.path.insert(0, './src')

Not sure if there's a more elegant way!

@ryanvilbrandt
Copy link
Owner

The working directory for the build_site.py and delete_autogenerated_files.py is assumed to be the root of the repository, since that's where the workflow's PWD starts at.

It'd probably be more elegant to just change everything so that scripts can be run from the scripts directory. This will need a change to the main.yaml file to cd into that directory first.

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

2 participants