Installing the package
I'm getting this error after trying all the following:
pip3 install pyyaml
- Setup a virtualenv using pipenv and install it there
- sudo
- Install v5.1
sudo python3 -m pip install pyyaml
The library in all cases seem to be properly installed.
$ pip3 show pyyaml
Name: PyYAML
Version: 5.4.1
Summary: YAML parser and emitter for Python
Home-page: https://pyyaml.org/
Author: Kirill Simonov
Author-email: xi@resolvent.net
License: MIT
Location: /usr/local/lib/python3.9/site-packages
In case of pipenv the location is
Location: /Users/<username>/.local/share/virtualenvs/webwatch-zMzxdqeP/lib/python3.8/site-packages
Usage
In the application I simply import pyyaml
and run it using either python3 <myapp>.py
or doing the same thing using pipenv shell.
Result
On all cases ModuleNotFoundError: No module named 'pyyaml'
More info
$ ls -ls /usr/bin/python*
0 lrwxr-xr-x 1 root wheel 75 Jun 15 2020 /usr/bin/python -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
0 lrwxr-xr-x 1 root wheel 82 Jun 15 2020 /usr/bin/python-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
0 lrwxr-xr-x 1 root wheel 75 Jun 15 2020 /usr/bin/python2 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
0 lrwxr-xr-x 1 root wheel 75 Jun 15 2020 /usr/bin/python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
0 lrwxr-xr-x 1 root wheel 82 Jun 15 2020 /usr/bin/python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
16 -rwxr-xr-x 1 root wheel 31488 Aug 10 2020 /usr/bin/python3
0 lrwxr-xr-x 1 root wheel 76 Jun 15 2020 /usr/bin/pythonw -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
0 lrwxr-xr-x 1 root wheel 76 Jun 15 2020 /usr/bin/pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
References: