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?
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.
Related
My goal is to work with Twitter API and do a sentiment analysize on tweets.
I am Working on a MAC, with VS Code on Anaconda.
I followed the tutorial and installed: python3 -m pip install --user virtualenv in my Terminal:
(base) Ludwigs-MBP:~ ludwigmehmke$ python3 -m pip install --user virtualenv
Requirement already satisfied: virtualenv in ./.local/lib/python3.7/site-packages (20.4.3)
Requirement already satisfied: six<2,>=1.9.0 in /opt/anaconda3/lib/python3.7/site-packages (from virtualenv) (1.12.0)
Requirement already satisfied: filelock<4,>=3.0.0 in /opt/anaconda3/lib/python3.7/site-packages (from virtualenv) (3.0.12)
Requirement already satisfied: distlib<1,>=0.3.1 in ./.local/lib/python3.7/site-packages (from virtualenv) (0.3.1)
Requirement already satisfied: appdirs<2,>=1.4.3 in ./.local/lib/python3.7/site-packages (from virtualenv) (1.4.4)
Requirement already satisfied: importlib-metadata>=0.12; python_version < "3.8" in /opt/anaconda3/lib/python3.7/site-packages (from virtualenv) (0.23)
Requirement already satisfied: zipp>=0.5 in /opt/anaconda3/lib/python3.7/site-packages (from importlib-metadata>=0.12; python_version < "3.8"->virtualenv) (0.6.0)
Requirement already satisfied: more-itertools in /opt/anaconda3/lib/python3.7/site-packages (from zipp>=0.5->importlib-metadata>=0.12; python_version < "3.8"->virtualenv) (7.2.0)
(base) Ludwigs-MBP:~ ludwigmehmke$
(base) Ludwigs-MBP:~ ludwigmehmke$
This is what I get. Next step was to create a Virtual Machine in VS Code. I entered the terminal there and created following code:
Ludwigs-MBP:Python ludwigmehmke$ python3 -m venv venv
Error: [Errno 1] Operation not permitted
I'm a bit new to using pip to install modules on Python. I believe I have pip installed, however when I try to use the module I've tried to install using pip it says there is no such module. I'll post terminal response to see what happened. I'd really appreciate if somebody can let me know if I'm making a mistake installing modules, thanks for your time.
faizrahman#138-38-186-80 ~ % sudo pip install matplotlib
Password:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: The directory '/Users/faizrahman/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (1.3.1)
Requirement already satisfied: numpy>=1.5 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (1.8.0rc1)
Requirement already satisfied: python-dateutil in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (1.5)
Requirement already satisfied: tornado in /Library/Python/2.7/site-packages (from matplotlib) (5.1.1)
Requirement already satisfied: pyparsing>=1.5.6 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (2.0.1)
Requirement already satisfied: nose in /Library/Python/2.7/site-packages (from matplotlib) (1.3.7)
Requirement already satisfied: singledispatch in /Library/Python/2.7/site-packages (from tornado->matplotlib) (3.4.0.3)
Requirement already satisfied: futures in /Library/Python/2.7/site-packages (from tornado->matplotlib) (3.3.0)
Requirement already satisfied: backports-abc>=0.4 in /Library/Python/2.7/site-packages (from tornado->matplotlib) (0.5)
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from singledispatch->tornado->matplotlib) (1.12.0)
faizrahman#138-38-186-80 ~ %
You will need to call pip from python3:
sudo python3 -m pip install matplotlib
I am following this tutorial: https://fastmachinelearning.org/hls4ml/setup/QUICKSTART.html
when I give the command:
root#ubuntu:~/Desktop/vivado/hls4ml/example-models$ hls4ml convert -c keras-config.yml
hls4ml: command not found
What should I do? I tried
pip install hls4ml
I get this:
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: hls4ml in /home/mojito/.local/lib/python2.7/site-packages (0.2.0)
Requirement already satisfied: numpy in /home/mojito/.local/lib/python2.7/site-packages (from hls4ml) (1.16.6)
Requirement already satisfied: six in /home/mojito/.local/lib/python2.7/site-packages (from hls4ml) (1.14.0)
Requirement already satisfied: pyyaml in /home/mojito/.local/lib/python2.7/site-packages (from hls4ml) (5.3.1)
Requirement already satisfied: h5py in /home/mojito/.local/lib/python2.7/site-packages (from hls4ml) (2.10.0)
Requirement already satisfied: onnx>=1.4.0 in /home/mojito/.local/lib/python2.7/site-packages (from hls4ml) (1.6.0)
Requirement already satisfied: typing>=3.6.4; python_version < "3.5" in /home/mojito/.local/lib/python2.7/site-packages (from onnx>=1.4.0->hls4ml) (3.7.4.1)
Requirement already satisfied: protobuf in /home/mojito/.local/lib/python2.7/site-packages (from onnx>=1.4.0->hls4ml) (3.11.3)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /home/mojito/.local/lib/python2.7/site-packages (from onnx>=1.4.0->hls4ml) (3.7.4.1)
Requirement already satisfied: setuptools in /home/mojito/.local/lib/python2.7/site-packages (from protobuf->onnx>=1.4.0->hls4ml) (44.1.0)
Try this:
$ git clone https://github.com/hls-fpga-machine-learning/hls4ml.git
$ cd hls4ml/
$ pip install .
Git repo: https://github.com/hls-fpga-machine-learning/models .
Also you can use pip as a module: $ python -m pip <command> [options]
I have not seen this issue in my google searches. I am trying to install PyInstaller on my work Mac which I do not have administrative access.
$ pip install --user pyinstaller
Collecting pyinstaller
Requirement already satisfied: dis3 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: setuptools in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: macholib>=1.8 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: pefile>=2017.8.1 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: altgraph>=0.15 in ./Library/Python/2.7/lib/python/site-packages (from macholib>=1.8->pyinstaller)
Requirement already satisfied: future in ./Library/Python/2.7/lib/python/site-packages (from pefile>=2017.8.1->pyinstaller)
Installing collected packages: pyinstaller
Successfully installed pyinstaller-3.3.1
The install seems successful, however...
$ pyinstaller
-bash: pyinstaller: command not found
I checked my PATH
$ echo $PATH
/usr/local/git/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/jc/Library/Python/2.7/lib/python/site-packages
What am I missing here?
Thanks for reading.
I had to install the tar.gz file from here:
http://www.pyinstaller.org/downloads.html
Then it can be run from the extracted folder.
$ python pyinstaller.py script.py
On my Mac pip installed the binary in /Users/%Username%/Library/Python/2.7/bin. If you add that to your PATH it should work.
In a Python package I have, in setup.py I modified the dependencies by removing the condition on the version number:
setup(
name='MyTool',
version='0.1.5',
author='myname',
author_email='myname#myname.com',
packages=['mytool'],
scripts=['bin/my_tool.py'],
url='https://pypi.python.org/pypi/mytool',
license='LICENSE.txt',
description='This is my tool.',
long_description=open('README.txt').read(),
install_requires=[
"scipy",
"numpy",
"prettytable"
],
)
I ran:
$ python setup.py sdist
$ python setup.py sdist upload
But when I run pip, it refers to the previous requirements:
$ sudo pip install MyTool
Requirement already satisfied (use --upgrade to upgrade): MyTool in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): scipy>=0.7.0 in /usr/local/lib/python2.7/dist-packages (from MyTool)
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/local/lib/python2.7/dist-packages (from MyTool)
Requirement already satisfied (use --upgrade to upgrade): prettytable>=0.7.2 in /usr/local/lib/python2.7/dist-packages (from MyTool)
Cleaning up...
What did I do wrong?
That means you have already installed package MyTool.
If you want to install the latest version (the uploaded version just now), try:
sudo pip install -U MyTool