Installing dependencies leads to exception: OSError: [Errno 13] Permission denied
Following the instructions here: ml-agents/docs/installation.md
Here's my system:
macOS Sierra 10.12.6
Xcode Version 9.2 (9C40b)
python --version Python 2.7.10
Unity 2017.1.0f3
From the python directory, running pip install . results in:
Successfully built docopt pluggy pandocfilters tornado configparser MarkupSafe functools32
Installing collected packages: pyzmq, jupyter-core, jupyter-client, six, singledispatch, certifi, backports-abc, tornado, ipykernel, functools32, jsonschema, nbformat, configparser, entrypoints, pandocfilters, testpath, MarkupSafe, jinja2, mistune, nbconvert, terminado, notebook, widgetsnbextension, ipywidgets, qtconsole, jupyter-console, jupyter, py, attrs, pluggy, pytest, docopt, unityagents
Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install **kwargs File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files isolated=self.isolated, File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files clobber(source, lib_dir, True) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 316, in clobber ensure_dir(destdir) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/init.py", line 83, in ensure_dir os.makedirs(path) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pyzmq-16.0.3.dist-info'
Running sudo pip install . results in:
The directory '/Users/rzero/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.
Installing collected packages: pyzmq, jupyter-core, jupyter-client, six, singledispatch, certifi, backports-abc, tornado, ipykernel, functools32, jsonschema, nbformat, configparser, entrypoints, pandocfilters, testpath, MarkupSafe, jinja2, mistune, nbconvert, terminado, notebook, widgetsnbextension, ipywidgets, qtconsole, jupyter-console, jupyter, py, attrs, pluggy, pytest, docopt, unityagents Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1: Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install requirement.uninstall(auto_confirm=True) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall paths_to_remove.remove(auto_confirm) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove renames(path, new_path) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/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 302, in move copy2(src, real_dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2 copystat(src, dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat os.chflags(dst, st.st_flags) OSError: [Errno 1] Operation not permitted: '/tmp/pip-_am1wB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
I've also tried:
sudo -H pip install .
pip install . --ignore-installed six
pip install . --upgrade --ignore-installed six
sudo -H python -m pip install . --ignore-installed six
sudo -H python -m pip install . --upgrade --ignore-installed six
Any help?
virtualenv fixed this for me:
cd ml-agents/python
python -m pip install --user virtualenv
python -m virtualenv env
source env/bin/activate
pip install .
(https://packaging.python.org/guides/installing-using-pip-and-virtualenv/)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.