xoltar / phat

Persistent Homology Algorithm Toolbox (copy of bitbucket fork, for visibility)
GNU Lesser General Public License v3.0
8 stars 2 forks source link

permission denied with pip install #1

Open vaiana opened 6 years ago

vaiana commented 6 years ago

I'm trying to install the python PHAT bindings inside of an Anaconda environment and it fails with a permission denied error.

pip install .
Processing /home/michael/repos/phat
Requirement already satisfied: pybind11 in /home/michael/miniconda3/envs/keras/lib/python3.6/site-
packages (from phat==1.5.0)
Installing collected packages: phat
   Running setup.py install for phat ... error
    Complete output from command /home/michael/miniconda3/envs/keras/bin/python -u -c "import 
setuptools, tokenize;__file__='/tmp/pip-6kkmu9x7-build/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --
record /tmp/pip-00niyajw-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
running build_ext
error: [Errno 13] Permission denied: '/home/michael/.local/lib/python3.6'

----------------------------------------
Command "/home/michael/miniconda3/envs/keras/bin/python -u -c "import setuptools, 
tokenize;__file__='/tmp/pip-6kkmu9x7-build/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --
record /tmp/pip-00niyajw-record/install-record.txt --single-version-externally-managed --compile" failed 
with error code 1 in /tmp/pip-6kkmu9x7-build/
xoltar commented 6 years ago

Hmm. @vaiana, what's on your PATH? Any other python installations there? What operating system?

vaiana commented 6 years ago

The pip and python I am using are those in my miniconda environment named keras. I am trying to install PHAT into my conda environment instead of system wide.

(keras) $: echo $PATH
/home/michael/miniconda3/envs/keras/bin:/home/mvaiana/anaconda3/bin:/
home/michael/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/
usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin`

The path contains miniconda3/env/keras/bin where pip and python live

(keras) $: which pip
/home/michael/miniconda3/envs/keras/bin/pip

(keras) $: which python
/home/michael/miniconda3/envs/keras/bin/python

The OS was originally Ubuntu 16.04 but I just upgraded to Ubuntu 17.10 and confirmed I get the same error.

xoltar commented 6 years ago

OK, this is strange. For me it works on 16.04, but it does create ~/.local/lib/python3.6/site-packages, even though it doesn't install anything there. Grepping for '.local' in the repo doesn't reveal anything, so I'm not sure where that's coming from. As a workaround, maybe make sure you have at least ~/.local/lib existing and writable by you.

rabihassaf-coder commented 5 years ago

I am having the same error on windows and python 3.7. Does the setup.py causes this error?

py -3.7 -m pip install phat Collecting phat Using cached https://files.pythonhosted.org/packages/43/82/c14de81dc2953a71a060f72f2bc34c41996307956b162751f2a47e2c78f7/phat-1.5.0a.tar.gz Requirement already satisfied: pybind11 in c:\users\rabih\appdata\local\programs\python\python37\lib\site-packages (from phat) (2.3.0) Installing collected packages: phat Running setup.py install for phat ... error ERROR: Complete output from command 'C:\Users\rabih\AppData\Local\Programs\Python\Python37\python.exe' -u -c 'import setuptools, tokenize;file='"'"'C:\Users\rabih\AppData\Local\Temp\pip-install-4ellxlg6\phat\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\rabih\AppData\Local\Temp\pip-record-qq_ufgsd\install-record.txt' --single-version-externally-managed --compile: ERROR: running install running build running build_py creating build creating build\lib.win-amd64-3.7 copying python\phat.py -> build\lib.win-amd64-3.7 running build_ext building '_phat' extension creating build\temp.win-amd64-3.7 creating build\temp.win-amd64-3.7\Release creating build\temp.win-amd64-3.7\Release\python C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iinclude -IC:\Users\rabih\AppData\Local\Programs\Python\Python37\Include -IC:\Users\rabih\AppData\Roaming\Python\Python37\Include -IC:\Users\rabih\AppData\Local\Programs\Python\Python37\include -IC:\Users\rabih\AppData\Local\Programs\Python\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tppython/_phat.cpp /Fobuild\temp.win-amd64-3.7\Release\python/_phat.obj /EHsc _phat.cpp python/_phat.cpp(208): warning C4244: '=': conversion from 'phat::index' to 'int', possible loss of data python/_phat.cpp(271): warning C4996: 'pybind11_init': PYBIND11_PLUGIN is deprecated, use PYBIND11_MODULE python/_phat.cpp(271): note: see declaration of 'pybind11_init' python/_phat.cpp(132): warning C4244: 'argument': conversion from '__int64' to 'phat::dimension', possible loss of data python/_phat.cpp(279): note: see reference to function template instantiation 'void wrap_boundary_matrix(pybind11::module &,const std::string &)' being compiled c:\users\rabih\appdata\local\programs\python\python37\include\pybind11\cast.h(1556): note: see reference to class template instantiation 'pybind11::detail::descr<8>' being compiled c:\users\rabih\appdata\local\programs\python\python37\include\pybind11\cast.h(1554): note: see reference to class template instantiation 'pybind11::detail::descr<5>' being compiled c:\users\rabih\appdata\local\programs\python\python37\include\pybind11\cast.h(1109): note: see reference to class template instantiation 'pybind11::detail::descr<7>' being compiled python/_phat.cpp(143): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(144): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(145): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(146): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(147): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(148): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(149): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(150): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(153): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(154): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(155): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(156): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(157): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(158): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(159): error C2902: 'operator': unexpected token following 'template', identifier expected python/_phat.cpp(160): error C2902: 'operator': unexpected token following 'template', identifier expected error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

ERROR: Command "'C:\Users\rabih\AppData\Local\Programs\Python\Python37\python.exe' -u -c 'import setuptools, tokenize;file='"'"'C:\Users\rabih\AppData\Local\Temp\pip-install-4ellxlg6\phat\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\rabih\AppData\Local\Temp\pip-record-qq_ufgsd\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\rabih\AppData\Local\Temp\pip-install-4ellxlg6\phat