Error on commit `env: python3.8: No such file or directory`
josiahdavis opened this issue · 2 comments
josiahdavis commented
When I go to make my initial commit I get this strange error:
env: python3.8: No such file or directory
Steps to reproduce:
conda create -y -n myenv python=3.7
conda activate myenv
pip install cookiecutter
cookiecutter https://github.com/verdimrc/py-ds-template
git init
pre-commit autoupdate
pre-commit install
git add -A
git commit -m "Initial commit for nhl util repository"
Result
env: python3.8: No such file or directory
Expected result
A successful commit.
System Information
MacOS
Python 3.7.10
josiahdavis commented
FWIW, here are the inputs I provided:
You've downloaded /Users/davjosia/.cookiecutters/py-ds-template before. Is it okay to delete and re-download it? [yes]: yes
project_name [My new project]: myproj
repo_name [my-repo]: myproj
author_name [Your name (or your organization/company/team)]: blah
description [A short description of the project.]: blah
Select open_source_license:
1 - No license file
2 - MIT License
3 - Apache-2.0 License
Choose from 1, 2, 3 [1]: 3
Select python_interpreter:
1 - python3
2 - python
Choose from 1, 2 [1]: 1
package_name []: myproj
Here is what my python is showing:
>> which python3
/Users/davjosia/opt/miniconda3/envs/myenv/bin/python3
>> which python
/Users/davjosia/opt/miniconda3/envs/myenv/bin/python
I also re-tried this using the python_interpreter = 2 option just for kicks.
josiahdavis commented
I was able to resolve this issue by uninstalling the pre-commit from by base conda environment. Then reinstalling from my new conda environment.
pre-commit uninstall # Can't remember if this step was necessary
conda deactivate
pre-commit uninstall # Having it in my base environment is what was messing it up
conda activate <my environment>
pre-commit install
# Works fine now