jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
528 stars 47 forks source link

zsh: command not found: mike #141

Closed timgavin closed 1 year ago

timgavin commented 1 year ago

I've installed mike per the instructions (macOS), yet I kept receiving this error

zsh: command not found: mike

So I added the packages directory to my PATH...

export PATH="${HOME}/Library/Python/3.9/lib/python/site-packages:$PATH"

and now when I run mike -V get zsh: permission denied: mike

Any ideas how to get mike working?

jimporter commented 1 year ago

Mike just uses the normal setuptools methods for installing the command-line scripts, so all it should take is for you to install it via the usual methods (probably pip install). The CI for mike verifies that this works on macOS; unfortunately, I don't use macOS myself, so I'm not able to provide any specific help here.

timgavin commented 1 year ago

I figured this out, and am leaving a comment in case anyone else has this issue.

macOS ships with Python 2, so I had previously installed Python 3 via Homebrew and forgot. This means that Python is now available at $ python3 instead of $ python. Same basically goes for Pip. So I uninstalled mike, then ran the following

$ pip3 install mike

I then had to update my PATH with the location to Python 3 in ~/.zshrc

export PATH="${HOME}/Library/Python/3.9/bin:$PATH"

Save the changes and close the file, then run $ source or start a new terminal session.

At this point I was able to run $ mike serve 👍