Installation issues on MAC_os High Sierra


#1

Hi,
Trying to install nupic on my MAC but getting this error:
IOError: [Errno 13] Permission denied: ‘/Users/…/Library/Python/2.7/bin/pytest’

This is a copy of the terminal:
MacBook-Pro:~ AMZ$ pip install nupic --user
Collecting nupic
Using cached nupic-1.0.3-py2-none-any.whl
Requirement already satisfied: psutil==1.0.1 in /Library/Python/2.7/site-packages (from nupic)
Requirement already satisfied: DBUtils==1.1 in /Library/Python/2.7/site-packages (from nupic)
Requirement already satisfied: PyYAML==3.10 in /Library/Python/2.7/site-packages (from nupic)
Collecting nupic.bindings==1.0.0 (from nupic)
Using cached nupic.bindings-1.0.0-cp27-cp27m-macosx_10_11_intel.whl
Collecting python-dateutil==2.1 (from nupic)
Using cached python-dateutil-2.1.tar.gz
Collecting validictory==0.9.1 (from nupic)
Using cached validictory-0.9.1.tar.gz
Collecting unittest2==0.5.1 (from nupic)
Using cached unittest2-0.5.1.zip
Collecting numpy==1.12.1 (from nupic)
Using cached numpy-1.12.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting asteval==0.9.1 (from nupic)
Using cached asteval-0.9.1.tar.gz
Requirement already satisfied: coverage==3.7.1 in ./Library/Python/2.7/lib/python/site-packages (from nupic)
Collecting pytest-xdist==1.16.0 (from nupic)
Using cached pytest-xdist-1.16.0.tar.gz
Collecting prettytable==0.7.2 (from nupic)
Using cached prettytable-0.7.2.zip
Collecting pycapnp==0.5.12; platform_system == “Linux” or platform_system == “Darwin” (from nupic)
Using cached pycapnp-0.5.12.tar.gz
Requirement already satisfied: pytest-cov==2.5.0 in ./Library/Python/2.7/lib/python/site-packages (from nupic)
Collecting pytest==3.0.7 (from nupic)
Using cached pytest-3.0.7-py2.py3-none-any.whl
Collecting pyproj==1.9.3 (from nupic)
Using cached pyproj-1.9.3.tar.gz
Collecting PyMySQL==0.6.2 (from nupic)
Using cached PyMySQL-0.6.2-py2.py3-none-any.whl
Collecting ordereddict==1.1 (from nupic)
Using cached ordereddict-1.1.tar.gz
Collecting mock==1.0.1 (from nupic)
Using cached mock-1.0.1.zip
Requirement already satisfied: six in ./Library/Python/2.7/lib/python/site-packages (from python-dateutil==2.1->nupic)
Requirement already satisfied: execnet>=1.1 in /Library/Python/2.7/site-packages (from pytest-xdist==1.16.0->nupic)
Requirement already satisfied: py>=1.4.22 in /Library/Python/2.7/site-packages (from pytest-xdist==1.16.0->nupic)
Requirement already satisfied: setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pytest==3.0.7->nupic)
Requirement already satisfied: apipkg>=1.4 in /Library/Python/2.7/site-packages (from execnet>=1.1->pytest-xdist==1.16.0->nupic)
Installing collected packages: pytest, pytest-xdist, numpy, pycapnp, nupic.bindings, python-dateutil, validictory, unittest2, asteval, prettytable, pyproj, PyMySQL, ordereddict, mock, nupic
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 784, in install
**kwargs
File “/Library/Python/2.7/site-packages/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/req/req_install.py”, line 1064, in move_wheel_files
isolated=self.isolated,
File “/Library/Python/2.7/site-packages/pip/wheel.py”, line 492, in move_wheel_files
maker.make_multiple([’%s = %s’ % kv for kv in console.items()])
File “/Library/Python/2.7/site-packages/pip/_vendor/distlib/scripts.py”, line 383, in make_multiple
filenames.extend(self.make(specification, options))
File “/Library/Python/2.7/site-packages/pip/_vendor/distlib/scripts.py”, line 372, in make
self._make_script(entry, filenames, options=options)
File “/Library/Python/2.7/site-packages/pip/_vendor/distlib/scripts.py”, line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File “/Library/Python/2.7/site-packages/pip/_vendor/distlib/scripts.py”, line 250, in _write_script
self._fileop.write_binary_file(outname, script_bytes)
File “/Library/Python/2.7/site-packages/pip/_vendor/distlib/util.py”, line 407, in write_binary_file
with open(path, ‘wb’) as f:
IOError: [Errno 13] Permission denied: ‘/Users/…/Library/Python/2.7/bin/pytest’

Any help is really appreciated.


#2

Do you have the right pip version as described here?


#3

I have version: 9.01

MacBook-Pro:~ $ pip --version
pip 9.0.1 from /Library/Python/2.7/site-packages (python 2.7)


#4

Can you try installing pytest alone with sudo?

sudo pip install pytest

#5

I’m getting this:
MacBook-Pro:~ $ sudo pip install pytest
The directory ‘/Users/AMZ/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/AMZ/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.
Requirement already satisfied: pytest in /Library/Python/2.7/site-packages
Requirement already satisfied: pluggy<0.7,>=0.5 in /Library/Python/2.7/site-packages (from pytest)
Requirement already satisfied: attrs>=17.2.0 in /Library/Python/2.7/site-packages (from pytest)
Requirement already satisfied: py>=1.5.0 in /Library/Python/2.7/site-packages (from pytest)
Requirement already satisfied: funcsigs; python_version < “3.0” in /Library/Python/2.7/site-packages (from pytest)
Requirement already satisfied: setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pytest)
Requirement already satisfied: six>=1.10.0 in ./Library/Python/2.7/lib/python/site-packages (from pytest)

I tried “sudo -H pip install pytest”, but I’m still getting the same issue with nupic!!!

Thanks,


#6

Try using chown to get ownership of the files
Or maybe chmod if that works on MAC OS

sudo chown -R $USER /Library/Python/2.7/bin/pytest

Try it using different paths, the above is just an example


#7

I have changed all folders and files to which I’m getting access denied to the chown mode. That works a little bit as more progress is achieved during the setup, but unfortunately a new error arise. This is the terminal output:

MacBook-Pro:~ $ pip install nupic --user
Collecting nupic
Using cached nupic-1.0.3-py2-none-any.whl …

capnp/lib/capnp.cpp:58877:39: warning: ‘getDependency’ is deprecated: Does not handle generics correctly. [-Wdeprecated-declarations]
__pyx_t_8 = __pyx_v_self->thisptr.getDependency(__pyx_t_7);
^
/usr/local/include/capnp/schema.h:85:43: note: ‘getDependency’ has been explicitly marked deprecated here
Schema getDependency(uint64_t id) const KJ_DEPRECATED(“Does not handle generics correctly.”);
^
/usr/local/include/kj/common.h:192:20: note: expanded from macro 'KJ_DEPRECATED’
attribute((deprecated(reason)))
^
capnp/lib/capnp.cpp:246:5: warning: destructor called on non-final ‘ErrorHandler’ that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
x->~T();
^
capnp/lib/capnp.cpp:81903:3: note: in instantiation of function template specialization ‘__Pyx_call_destructor’ requested here
__Pyx_call_destructor(&p->_error_handler);
^
capnp/lib/capnp.cpp:246:9: note: qualify call to silence this warning
x->~T();
^
ErrorHandler::
23 warnings and 1 error generated.
error: command ‘cc’ failed with exit status 1

----------------------------------------

Command “/usr/bin/python -u -c “import setuptools, tokenize;file=’/private/var/folders/nn/nlkk27m12kj4zbfxsqhgnj0m0000gn/T/pip-build-93u3g7/pycapnp/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /var/folders/nn/nlkk27m12kj4zbfxsqhgnj0m0000gn/T/pip-qmhLYo-record/install-record.txt --single-version-externally-managed --compile --user --prefix=” failed with error code 1 in /private/var/folders/nn/nlkk27m12kj4zbfxsqhgnj0m0000gn/T/pip-build-93u3g7/pycapnp/

FYI:
I tried to use “export MACOSX_DEPLOYMENT_TARGET=10.10” but got error related to the configuration. Thus, I re-set the target to 10.13

Thank you…


#8

I would recommend installing(reinstalling) gcc or clang and trying again. Preference is gcc.

Also stackoverflow has much more information about this than this forum could hope to generate.


#9

I tried several suggestions but I’m getting the same error. I reinstalled xcode and clang but nothing changed!!! Also, tried the suggestions in this post but with no luck!!

Thanks,


#10

I’d still give gcc a try.