Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install nose without superuser privileges #1017

Open
ngoldbaum opened this issue Sep 26, 2016 · 6 comments
Open

Cannot install nose without superuser privileges #1017

ngoldbaum opened this issue Sep 26, 2016 · 6 comments

Comments

@ngoldbaum
Copy link

Currently when I try to install nose with pip, I'm getting the following error:

$ pip install -U nose
Collecting nose
  Using cached nose-1.3.7-py2-none-any.whl
Installing collected packages: nose
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 378, in move_wheel_files
    clobber(source, dest, False, fixer=fixer, filter=filter)
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 317, in clobber
    ensure_dir(destdir)
  File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/man'

I'm unsure why pip is trying to write to /usr/local here. After asking on pypi, someone suggested it was due to this line in nose's setup.py file: https://github.com/nose-devs/nose/blob/master/setup.py#L109

@ngoldbaum
Copy link
Author

FWIW, if I remove line 109 from nose's setup.py file, I'm able to successfully install.

@sparr
Copy link

sparr commented Sep 13, 2017

Just encountered this problem myself, while installing something depending on nose. Took a while to narrow the problem down and find this issue.

Creating /usr/local/man myself resolves the problem, and the installer doesn't even create a file there. Not sure what's going wrong here that produces this behavior.

@sparr
Copy link

sparr commented Sep 13, 2017

A fix for Homebrew/install#109 will resolve this problem.

@sparr
Copy link

sparr commented Sep 13, 2017

Homebrew/install#109 is closed and won't be addressed.

resolving this problem will require either convincing the nose devs to put their man page in /usr/local/share/man or convincing the homebrew-core python formula devs to modify the behavior of pip to recognize attempts to write to /usr/local/man should end up in /usr/local/share/man

@sparr
Copy link

sparr commented Sep 13, 2017

@ngoldbaum
Copy link
Author

I would suggest that nose not try to install the man page at all. If someone needs to package the man page for e.g. debian, they can do that manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants