Feb-06-2018, 06:26 PM
Hello,
I am running both Python 2.7.10 and Python 3.5 on MacOS 10.12.6. This was previously not an issue as I mainly used the python 2.7 installation (default on MacOS I believe). However, in using packages specific to Python 3.x I realized I did not know how to install packages for this installation only.
For example, I wanted to install Bokeh, here's what I did:
1) What are the likely causes of the pip3.5 command not properly installing bokeh despite not producing error messages ? Is it somehow installing to yet another installation on my computer that I am not aware is installed ?
2) Would I need an 'environment management software' (not sure exact name) such as Brew in the future to avoid this mess I put myself in or can this be sorted out with pip ?
Hope I provided enough info for you all to know what is going on.
Thanks !
I am running both Python 2.7.10 and Python 3.5 on MacOS 10.12.6. This was previously not an issue as I mainly used the python 2.7 installation (default on MacOS I believe). However, in using packages specific to Python 3.x I realized I did not know how to install packages for this installation only.
For example, I wanted to install Bokeh, here's what I did:
Alexandres-Air:python Alexandre$ sudo pip install bokeh Password:
Output:The directory '/Users/Alexandre/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/Alexandre/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting bokeh
Collecting python-dateutil>=2.1 (from bokeh)
Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
100% |████████████████████████████████| 194kB 1.8MB/s
Requirement already satisfied: tornado>=4.3 in /Library/Python/2.7/site-packages (from bokeh)
Requirement already satisfied: numpy>=1.7.1 in /Users/Alexandre/Library/Python/2.7/lib/python/site-packages (from bokeh)
Requirement already satisfied: PyYAML>=3.10 in /Library/Python/2.7/site-packages (from bokeh)
Requirement already satisfied: Jinja2>=2.7 in /Library/Python/2.7/site-packages (from bokeh)
Requirement already satisfied: futures>=3.0.3 in /Library/Python/2.7/site-packages (from bokeh)
Requirement already satisfied: six>=1.5.2 in /Users/Alexandre/Library/Python/2.7/lib/python/site-packages (from bokeh)
Requirement already satisfied: singledispatch in /Library/Python/2.7/site-packages (from tornado>=4.3->bokeh)
Requirement already satisfied: certifi in /Library/Python/2.7/site-packages (from tornado>=4.3->bokeh)
Requirement already satisfied: backports-abc>=0.4 in /Library/Python/2.7/site-packages (from tornado>=4.3->bokeh)
Requirement already satisfied: backports.ssl-match-hostname in /Library/Python/2.7/site-packages (from tornado>=4.3->bokeh)
Requirement already satisfied: MarkupSafe>=0.23 in /Library/Python/2.7/site-packages (from Jinja2>=2.7->bokeh)
Installing collected packages: python-dateutil, bokeh
Found existing installation: python-dateutil 1.5
Uninstalling python-dateutil-1.5:
Error:Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
copytree(src, real_dst, symlinks=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
raise Error, errors
Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.py', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.py', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.pyc', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.py', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.py', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.pyc', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/easter.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.py', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.py', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.pyc', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.py', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.py', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.pyc', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.py', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.py', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.pyc', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/rrule.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.py', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.py', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.pyc', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tz.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.py', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.py', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.pyc', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/tzwin.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.py', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.py', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.pyc', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.pyc', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/zoneinfo-2010g.tar.gz', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/zoneinfo-2010g.tar.gz', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo/zoneinfo-2010g.tar.gz'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/zoneinfo'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil', '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil', "[Errno 1] Operation not permitted: '/tmp/pip-Vukm5C-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil'")]
My thought was that maybe this package was specific to Python 3.x and therefore I tried the following:Alexandres-Air:python Alexandre$ pip3.5 install bokeh
Output:Collecting bokeh
Using cached bokeh-0.12.13.tar.gz
Requirement already satisfied: six>=1.5.2 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bokeh)
Collecting PyYAML>=3.10 (from bokeh)
Using cached PyYAML-3.12.tar.gz
Requirement already satisfied: python-dateutil>=2.1 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bokeh)
Requirement already satisfied: Jinja2>=2.7 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bokeh)
Requirement already satisfied: numpy>=1.7.1 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bokeh)
Requirement already satisfied: tornado>=4.3 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from bokeh)
Requirement already satisfied: MarkupSafe>=0.23 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from Jinja2>=2.7->bokeh)
Building wheels for collected packages: bokeh, PyYAML
Running setup.py bdist_wheel for bokeh ... done
Stored in directory: /Users/Alexandre/Library/Caches/pip/wheels/a7/2c/4a/96740179eabf7ddba1f7ae36ba96540e8a7e557936eaab4829
Running setup.py bdist_wheel for PyYAML ... done
Stored in directory: /Users/Alexandre/Library/Caches/pip/wheels/2c/f7/79/13f3a12cd723892437c0cfbde1230ab4d82947ff7b3839a4fc
Successfully built bokeh PyYAML
Installing collected packages: PyYAML, bokeh
Successfully installed PyYAML-3.12 bokeh-0.12.13
Alexandres-Air:python Alexandre$ python3.5
Python 3.5.0 (default, Sep 23 2015, 04:42:00) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.72)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import bokeh
Error:Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'bokeh'
Given the above:1) What are the likely causes of the pip3.5 command not properly installing bokeh despite not producing error messages ? Is it somehow installing to yet another installation on my computer that I am not aware is installed ?
2) Would I need an 'environment management software' (not sure exact name) such as Brew in the future to avoid this mess I put myself in or can this be sorted out with pip ?
Hope I provided enough info for you all to know what is going on.
Thanks !