Should you really use /usr/bin/env? Plays badly with conda
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 233
- Avg merge
- 1h 44m
- Merged PRs (30d)
- 1
Description
I installed khal in arch linux (simply sudo pacman -Syu khal) and when I ran khal in the terminal it gave a ModuleNotFoundError: No module named 'khal' for the line from khal.cli import main_khal in /usr/bin/khal. After a little bit of debugging it turns out that installing khal installs it in the system python, not the conda python that I use for my own code (as it should) but writing the shebang #!/usr/bin/env python causes /usr/bin/khal to execute with my conda python, since that is what is first in my path. Maybe you should change this to #!/usr/bin/python to use the system python instead. That worked for me at least.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the installed /usr/bin/khal entry point and the khal.cli import under both the conda and system Python environments. Reproduce the ModuleNotFoundError with conda first on PATH, then verify the packaged command consistently uses the environment where khal is installed and that the failure no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100