3

I'm following the mkdocs setup process here: http://www.mkdocs.org/#installation

I'm not able to get mkdocs to do anything past the install on my local machine. I've installed the latest python and pip. I've verified the mkdocs package is installed, but still nothing:

$ mkdocs --version
-bash: mkdocs: command not found

$ python --version
Python 2.7.10
$ pip --version
pip 8.0.2 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)

$ which python
/usr/local/bin/python

$ pip install mkdocs --upgrade
Requirement already up-to-date: mkdocs in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Requirement already up-to-date: Markdown>=2.3.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: livereload>=2.3.2 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: PyYAML>=3.10 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: tornado>=4.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: Jinja2>=2.7.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: click>=3.3 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: mkdocs-bootswatch>=0.1.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: mkdocs-bootstrap>=0.1.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: six in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from livereload>=2.3.2->mkdocs)
Requirement already up-to-date: backports.ssl-match-hostname in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from tornado>=4.1->mkdocs)
Requirement already up-to-date: singledispatch in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from tornado>=4.1->mkdocs)
Requirement already up-to-date: certifi in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from tornado>=4.1->mkdocs)
Requirement already up-to-date: backports-abc>=0.4 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from tornado>=4.1->mkdocs)
Requirement already up-to-date: MarkupSafe in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from Jinja2>=2.7.1->mkdocs)
$ cd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
$ mkdocs
-bash: mkdocs: command not found
$ cd ~/
$ mkdocs --version
-bash: mkdocs: command not found

Are there additional steps needed to get mkdocs running on OSX?

George Ortiz
  • 97
  • 2
  • 9
  • This is the PATH in my .bash_profile: `export PATH="/usr/local/sbin:$PATH" ### Added by the Heroku Toolbelt export PATH="/usr/local/heroku/bin:$PATH" # Setting PATH for Python 2.7 # The orginal version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" export PATH` – George Ortiz Feb 10 '16 at 03:41
  • did you check in mkdocs is in one of those places? – john elemans Feb 10 '16 at 04:13
  • yes, mkdocs is in the last PATH var `/Library/Frameworks/Python.framework/Versions/2.7/bin` along with pip and all other py packages. – George Ortiz Feb 10 '16 at 17:16
  • very odd. is the executable flag set? can you run it from inside the folder it is in? – john elemans Feb 10 '16 at 18:10
  • I cannot run it from within inside the folder. It's pretty weird. I've tried to run it from within `/Library/Frameworks/Python.framework/Versions/2.7/bin` and also from within `/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages` where it shows mkdocs. I've also verified the install by doing `pip install mkdocs --upgrade` and everything is good. – George Ortiz Feb 10 '16 at 18:42
  • the executable flag confirmed? – john elemans Feb 10 '16 at 19:23
  • 1
    Try typing hash -r to rehash the command lookup table in your shell – D.Shawley Feb 10 '16 at 19:37
  • @johnelemans and @dshawley - I think the solution was a combination of both your comments. I got it finally working, recognizing mkdocs commands by going back and verifying the PATH, running `source ~/.bash_profile`, closing terminal, and then running mkdocs. Previous I was saving edits to the PATH var in the .bash_profile, but was not running `source ~/.bash_profile` and restarting terminal. Happy to award answer to @johnelemans for your time in the comments. – George Ortiz Feb 10 '16 at 20:12

1 Answers1

2

I have encountered the same problem.

-bash: mkdocs: command not found

After setting the environment variable, it can be used.

sudo vim ~/.bash_profile

Append the following to the file and note that the path is replaced by yourself.

PATH="/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/:${PATH}"
export PATH

Make environment variables take effect.

source ~/.bash_profile

Then you can test it.

linupypc:~ linupy$ mkdocs
Usage: mkdocs [OPTIONS] COMMAND [ARGS]...

MkDocs - Project documentation with Markdown.

Options:
  -V, --version  Show the version and exit.
  -q, --quiet    Silence warnings
  ...

The rest, you should be able to operate. good luck.