Reputation: 192
I am trying to npm install
for a project in my mac but for some reason it says python not found even though python3
command is working fine and I also set alias python to python3 in by ~/.zshrc
and ~/.bash-profile
and restarted several times but still the same issue.
Screenshot of the issue.
Upvotes: 6
Views: 20138
Reputation: 24406
The problem is that Python is required in the system path to operate this command. Solutions:
pyenv
pyenv install 2.7.18
or pyenv install 3.9.11
(for example)pyenv global 3.9.11
pyenv
to your system path
~/.bashrc
or ~/.zshrc
: export PATH=$(pyenv root)/shims:$PATH
, then run source ~/.bashrc
or source ~/.zshrc
npm config set python C:\Library\Python\Python310\python.exe
(for example) via administratornpm install
againUpvotes: 15