FAQ / Troubleshooting๏
๐งฉ Common issues and how to fix them when working with this project template.
๐ Import Error: from template_project import plotters๏
Problem: Python canโt find the template_project module.
โ Option 1: Install the package locally (recommended)๏
Activate your environment:
micromamba activate template_env # or conda activate template_env
Then install your project in โeditableโ mode:
pip install -e .
This lets Python find your package and reflects changes without needing to reinstall. Restart your kernel to apply changes.
๐ See also: setup.md
๐ Option 2: Add the path manually (in a notebook)๏
If youโre working in a Jupyter notebook and havenโt installed the package, insert this before importing:
import sys
sys.path.append("/path/to/your/template-project")
Then you can run:
from template_project import plotters
This is useful for testing during development, but installation is preferred.
๐ฅ Pip install error in GitHub Actions๏
Error message:
ร Getting requirements to build editable did not run successfully.
โ exit code: 1
โฐโ> See above for output.
This usually means something is wrong with the local installation process. Try the following locally in a clean environment:
virtualenv venv
source venv/bin/activate && micromamba deactivate
pip install -r requirements.txt
pip install -e .
If this works locally, your GitHub Actions will likely succeed too.
๐ GitHub workflows live in .github/workflows/*.yml
๐ค Whatโs the difference between template-project and template_project?๏
template-projectis the name of the repository โ itโs fine to use hyphens in GitHub repo names.template_projectis the name of the Python package (i.e., the importable module) โ dashes are not allowed in Python package names.
Term |
Use For |
|---|---|
|
GitHub repository name |
|
Python package ( |
Could they be the same name?๏
โ Yes: Both could be
template_project๐ซ No: Avoid
template-projectfor the Python module
Why this setup?๏
Originally accidental, but it reinforces the distinction between repo and code module.
Helps clarify which name to use in each context, especially when editing docs, imports, or packaging configs.
๐ฌ I accidentally committed to main instead of a branch๏
It happens! If you havenโt pushed yet:
๐งผ Option 1: Create a new branch from the current commit๏
git branch new-feature-branch
Then switch to it:
git checkout new-feature-branch
Youโre now safe to push your changes and create a pull request.
๐ Option 2: Move the commit off main (before push)๏
git branch temp-fix
git reset --hard origin/main # resets main to the last pushed commit
git checkout temp-fix
Now your main is clean and you can cherry-pick or merge your changes onto a feature branch properly.
โ ๏ธ Only use
reset --hardif youโre sure you havenโt pushed yet and donโt need to keep local-only changes.
๐จ Continuous Integration (CI) is failing๏
๐งช If the failure is in tests:๏
Run tests locally to reproduce the issue:
pytest
Try running an individual test:
pytest tests/test_tools.py::test_my_function
๐ See: writing_tests.md
๐ If the failure is in documentation:๏
Try rebuilding the docs locally:
cd docs
make html
Then open _build/html/index.html in a browser.
๐ See: build_docs.md
If your changes involve docstrings or .md files, a local preview will help catch errors before pushing.
๐ก The GitHub Actions logs show exactly which step failed โ start there!
๐งญ How do I check which branch Iโm on?๏
In the terminal:
git branch
The active branch is marked with an asterisk.
In VSCode:
Look at the lower-left corner โ your current branch name is shown there.
๐ I cloned the repo but donโt see the latest updates๏
Make sure youโre on the main branch and that itโs up to date:
git checkout main
git pull origin main
If you forked the repo, check out gitcollab.md for syncing instructions.
โ๏ธ I made changes but GitHub doesnโt show them๏
You need to commit and push your work:
git add .
git commit -m "Describe your changes"
git push origin your-branch-name
๐ก Pushing updates your branch on GitHub. Committing saves changes locally.
๐ I opened a pull request โ what happens now?๏
Your changes will be reviewed.
GitHub Actions (CI) will check that tests and docs pass.
You might be asked to tweak something.
Once all is approved, your changes will be merged.
๐ Still stuck?๏
Check setup.md, or ask a question by opening an issue at github.com/eleanorfrajka/template-project.
โ This FAQ is a living document โ feel free to suggest improvements!