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

Installation failure with Homebrew #1355

Closed
gwerbin opened this issue Aug 2, 2017 · 11 comments
Closed

Installation failure with Homebrew #1355

gwerbin opened this issue Aug 2, 2017 · 11 comments
Labels

Comments

@gwerbin
Copy link

gwerbin commented Aug 2, 2017

I'm encountering an error when trying to install Hy with Pip. My setup is vanilla Python3-on-Homebrew-on-MacOS, so Python3 is installed to /usr/local/Cellar/python3/3.6.2 and symlinked into /usr/local/opt/python3 as well as /usr/local. I have the latest versions of both Pip and Setuptools with pip3 install -U pip setuptools.

pip3 show setuptools | grep Version
# Version: 36.2.7
pip3 --version
# pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)

It seems like the problem is that setup.py is trying to install the get_version script in /usr/local rather than /usr/local/bin or somewhere else. I have the same problem when I brew unlink python3 and use the MacPorts version instead (sudo port install python36 py36-pip). I'd rather not change the permissions on /usr/local.

(WARNING: wall of CLI output incoming)

This is what I get when I try pip3 install hy:

$ pip3 install hy
Collecting hy
Requirement already satisfied: astor>=0.5 in /usr/local/lib/python3.6/site-packages (from hy)
Requirement already satisfied: clint>=0.4 in /usr/local/lib/python3.6/site-packages (from hy)
Requirement already satisfied: rply>=0.7.0 in /usr/local/lib/python3.6/site-packages (from hy)
Requirement already satisfied: args in /usr/local/lib/python3.6/site-packages (from clint>=0.4->hy)
Requirement already satisfied: appdirs in /usr/local/lib/python3.6/site-packages (from rply>=0.7.0->hy)
Installing collected packages: hy
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python3.6/site-packages/pip/wheel.py", line 377, in move_wheel_files
    clobber(source, dest, False, fixer=fixer, filter=filter)
  File "/usr/local/lib/python3.6/site-packages/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "/usr/local/lib/python3.6/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/get_version'

And pip3 install git+https://github.com/hylang/hy.git:

Collecting git+https://github.com/hylang/hy.git
  Cloning https://github.com/hylang/hy.git to /private/var/folders/4j/n8nxnsy12y92t475g318yptm0000gn/T/pip-q1p7vb4d-build
Requirement already satisfied: rply>=0.7.5 in /usr/local/lib/python3.6/site-packages (from hy==0.13.0+54.g4fd1c7b)
Requirement already satisfied: astor>=0.5 in /usr/local/lib/python3.6/site-packages (from hy==0.13.0+54.g4fd1c7b)
Requirement already satisfied: clint>=0.4 in /usr/local/lib/python3.6/site-packages (from hy==0.13.0+54.g4fd1c7b)
Requirement already satisfied: appdirs in /usr/local/lib/python3.6/site-packages (from rply>=0.7.5->hy==0.13.0+54.g4fd1c7b)
Requirement already satisfied: args in /usr/local/lib/python3.6/site-packages (from clint>=0.4->hy==0.13.0+54.g4fd1c7b)
Installing collected packages: hy
  Running setup.py install for hy ... error
    Complete output from command /usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/4j/n8nxnsy12y92t475g318yptm0000gn/T/pip-q1p7vb4d-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 /var/folders/4j/n8nxnsy12y92t475g318yptm0000gn/T/pip-n74l3mg7-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/hy
    copying hy/__init__.py -> build/lib/hy
    copying hy/__main__.py -> build/lib/hy
    copying hy/_compat.py -> build/lib/hy
    copying hy/cmdline.py -> build/lib/hy
    copying hy/compiler.py -> build/lib/hy
    copying hy/completer.py -> build/lib/hy
    copying hy/errors.py -> build/lib/hy
    copying hy/importer.py -> build/lib/hy
    copying hy/macros.py -> build/lib/hy
    copying hy/models.py -> build/lib/hy
    copying hy/version.py -> build/lib/hy
    creating build/lib/hy/contrib
    copying hy/contrib/__init__.py -> build/lib/hy/contrib
    creating build/lib/hy/core
    copying hy/core/__init__.py -> build/lib/hy/core
    creating build/lib/hy/extra
    copying hy/extra/__init__.py -> build/lib/hy/extra
    creating build/lib/hy/lex
    copying hy/lex/__init__.py -> build/lib/hy/lex
    copying hy/lex/exceptions.py -> build/lib/hy/lex
    copying hy/lex/lexer.py -> build/lib/hy/lex
    copying hy/lex/parser.py -> build/lib/hy/lex
    copying hy/contrib/botsbuildbots.hy -> build/lib/hy/contrib
    copying hy/contrib/hy_repr.hy -> build/lib/hy/contrib
    copying hy/contrib/loop.hy -> build/lib/hy/contrib
    copying hy/contrib/multi.hy -> build/lib/hy/contrib
    copying hy/contrib/profile.hy -> build/lib/hy/contrib
    copying hy/contrib/sequences.hy -> build/lib/hy/contrib
    copying hy/contrib/walk.hy -> build/lib/hy/contrib
    creating build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/__init__.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/botsbuildbots.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/hy_repr.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/loop.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/multi.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/profile.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/sequences.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/walk.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/core/bootstrap.hy -> build/lib/hy/core
    copying hy/core/language.hy -> build/lib/hy/core
    copying hy/core/macros.hy -> build/lib/hy/core
    copying hy/core/shadow.hy -> build/lib/hy/core
    creating build/lib/hy/core/__pycache__
    copying hy/core/__pycache__/__init__.cpython-36.pyc -> build/lib/hy/core/__pycache__
    copying hy/core/__pycache__/bootstrap.cpython-36.pyc -> build/lib/hy/core/__pycache__
    copying hy/core/__pycache__/language.cpython-36.pyc -> build/lib/hy/core/__pycache__
    copying hy/core/__pycache__/macros.cpython-36.pyc -> build/lib/hy/core/__pycache__
    copying hy/core/__pycache__/shadow.cpython-36.pyc -> build/lib/hy/core/__pycache__
    copying hy/extra/anaphoric.hy -> build/lib/hy/extra
    copying hy/extra/reserved.hy -> build/lib/hy/extra
    creating build/lib/hy/extra/__pycache__
    copying hy/extra/__pycache__/__init__.cpython-36.pyc -> build/lib/hy/extra/__pycache__
    copying hy/extra/__pycache__/anaphoric.cpython-36.pyc -> build/lib/hy/extra/__pycache__
    copying hy/extra/__pycache__/reserved.cpython-36.pyc -> build/lib/hy/extra/__pycache__
    running install_lib
    copying build/lib/hy/__init__.py -> /usr/local/lib/python3.6/site-packages/hy
    copying build/lib/hy/__main__.py -> /usr/local/lib/python3.6/site-packages/hy
    copying build/lib/hy/_compat.py -> /usr/local/lib/python3.6/site-packages/hy
    copying build/lib/hy/cmdline.py -> /usr/local/lib/python3.6/site-packages/hy
    copying build/lib/hy/compiler.py -> /usr/local/lib/python3.6/site-packages/hy
    copying build/lib/hy/completer.py -> /usr/local/lib/python3.6/site-packages/hy
    copying build/lib/hy/contrib/__init__.py -> /usr/local/lib/python3.6/site-packages/hy/contrib
    copying build/lib/hy/contrib/__pycache__/__init__.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/botsbuildbots.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/hy_repr.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/loop.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/multi.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/profile.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/sequences.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/walk.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/botsbuildbots.hy -> /usr/local/lib/python3.6/site-packages/hy/contrib
    copying build/lib/hy/contrib/hy_repr.hy -> /usr/local/lib/python3.6/site-packages/hy/contrib
    copying build/lib/hy/contrib/loop.hy -> /usr/local/lib/python3.6/site-packages/hy/contrib
    copying build/lib/hy/contrib/multi.hy -> /usr/local/lib/python3.6/site-packages/hy/contrib
    copying build/lib/hy/contrib/profile.hy -> /usr/local/lib/python3.6/site-packages/hy/contrib
    copying build/lib/hy/contrib/sequences.hy -> /usr/local/lib/python3.6/site-packages/hy/contrib
    copying build/lib/hy/contrib/walk.hy -> /usr/local/lib/python3.6/site-packages/hy/contrib
    copying build/lib/hy/core/__init__.py -> /usr/local/lib/python3.6/site-packages/hy/core
    copying build/lib/hy/core/__pycache__/__init__.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/core/__pycache__
    copying build/lib/hy/core/__pycache__/bootstrap.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/core/__pycache__
    copying build/lib/hy/core/__pycache__/language.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/core/__pycache__
    copying build/lib/hy/core/__pycache__/macros.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/core/__pycache__
    copying build/lib/hy/core/__pycache__/shadow.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/core/__pycache__
    copying build/lib/hy/core/bootstrap.hy -> /usr/local/lib/python3.6/site-packages/hy/core
    copying build/lib/hy/core/language.hy -> /usr/local/lib/python3.6/site-packages/hy/core
    copying build/lib/hy/core/macros.hy -> /usr/local/lib/python3.6/site-packages/hy/core
    copying build/lib/hy/core/shadow.hy -> /usr/local/lib/python3.6/site-packages/hy/core
    copying build/lib/hy/errors.py -> /usr/local/lib/python3.6/site-packages/hy
    copying build/lib/hy/extra/__init__.py -> /usr/local/lib/python3.6/site-packages/hy/extra
    copying build/lib/hy/extra/__pycache__/__init__.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/extra/__pycache__
    copying build/lib/hy/extra/__pycache__/anaphoric.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/extra/__pycache__
    copying build/lib/hy/extra/__pycache__/reserved.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/extra/__pycache__
    copying build/lib/hy/extra/anaphoric.hy -> /usr/local/lib/python3.6/site-packages/hy/extra
    copying build/lib/hy/extra/reserved.hy -> /usr/local/lib/python3.6/site-packages/hy/extra
    copying build/lib/hy/importer.py -> /usr/local/lib/python3.6/site-packages/hy
    creating /usr/local/lib/python3.6/site-packages/hy/lex
    copying build/lib/hy/lex/__init__.py -> /usr/local/lib/python3.6/site-packages/hy/lex
    copying build/lib/hy/lex/exceptions.py -> /usr/local/lib/python3.6/site-packages/hy/lex
    copying build/lib/hy/lex/lexer.py -> /usr/local/lib/python3.6/site-packages/hy/lex
    copying build/lib/hy/lex/parser.py -> /usr/local/lib/python3.6/site-packages/hy/lex
    copying build/lib/hy/macros.py -> /usr/local/lib/python3.6/site-packages/hy
    copying build/lib/hy/models.py -> /usr/local/lib/python3.6/site-packages/hy
    copying build/lib/hy/version.py -> /usr/local/lib/python3.6/site-packages/hy
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/__init__.py to __init__.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/__main__.py to __main__.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/_compat.py to _compat.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/cmdline.py to cmdline.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/compiler.py to compiler.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/completer.py to completer.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/errors.py to errors.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/importer.py to importer.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/lex/__init__.py to __init__.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/lex/exceptions.py to exceptions.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/lex/lexer.py to lexer.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/lex/parser.py to parser.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/macros.py to macros.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/models.py to models.cpython-36.pyc
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/version.py to version.cpython-36.pyc
    running install_data
    creating /usr/local/get_version
    error: could not create '/usr/local/get_version': Permission denied

    ----------------------------------------
Command "/usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/4j/n8nxnsy12y92t475g318yptm0000gn/T/pip-q1p7vb4d-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 /var/folders/4j/n8nxnsy12y92t475g318yptm0000gn/T/pip-n74l3mg7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/4j/n8nxnsy12y92t475g318yptm0000gn/T/pip-q1p7vb4d-build/

And finally git clone hy && pip3 install ./hy:

Processing /Users/symb0lic/src/hy
Requirement already satisfied: rply>=0.7.5 in /usr/local/lib/python3.6/site-packages (from hy==0.13.0+54.g4fd1c7b)
Requirement already satisfied: astor>=0.5 in /usr/local/lib/python3.6/site-packages (from hy==0.13.0+54.g4fd1c7b)
Requirement already satisfied: clint>=0.4 in /usr/local/lib/python3.6/site-packages (from hy==0.13.0+54.g4fd1c7b)
Requirement already satisfied: appdirs in /usr/local/lib/python3.6/site-packages (from rply>=0.7.5->hy==0.13.0+54.g4fd1c7b)
Requirement already satisfied: args in /usr/local/lib/python3.6/site-packages (from clint>=0.4->hy==0.13.0+54.g4fd1c7b)
Installing collected packages: hy
  Running setup.py install for hy ... error
    Complete output from command /usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/4j/n8nxnsy12y92t475g318yptm0000gn/T/pip-9yq8xr33-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 /var/folders/4j/n8nxnsy12y92t475g318yptm0000gn/T/pip-7aj73z0l-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/hy
    copying hy/__init__.py -> build/lib/hy
    copying hy/__main__.py -> build/lib/hy
    copying hy/_compat.py -> build/lib/hy
    copying hy/cmdline.py -> build/lib/hy
    copying hy/compiler.py -> build/lib/hy
    copying hy/completer.py -> build/lib/hy
    copying hy/errors.py -> build/lib/hy
    copying hy/importer.py -> build/lib/hy
    copying hy/macros.py -> build/lib/hy
    copying hy/models.py -> build/lib/hy
    copying hy/version.py -> build/lib/hy
    creating build/lib/hy/contrib
    copying hy/contrib/__init__.py -> build/lib/hy/contrib
    creating build/lib/hy/core
    copying hy/core/__init__.py -> build/lib/hy/core
    creating build/lib/hy/extra
    copying hy/extra/__init__.py -> build/lib/hy/extra
    creating build/lib/hy/lex
    copying hy/lex/__init__.py -> build/lib/hy/lex
    copying hy/lex/exceptions.py -> build/lib/hy/lex
    copying hy/lex/lexer.py -> build/lib/hy/lex
    copying hy/lex/parser.py -> build/lib/hy/lex
    copying hy/contrib/botsbuildbots.hy -> build/lib/hy/contrib
    copying hy/contrib/hy_repr.hy -> build/lib/hy/contrib
    copying hy/contrib/loop.hy -> build/lib/hy/contrib
    copying hy/contrib/multi.hy -> build/lib/hy/contrib
    copying hy/contrib/profile.hy -> build/lib/hy/contrib
    copying hy/contrib/sequences.hy -> build/lib/hy/contrib
    copying hy/contrib/walk.hy -> build/lib/hy/contrib
    creating build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/__init__.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/botsbuildbots.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/hy_repr.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/loop.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/multi.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/profile.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/sequences.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/contrib/__pycache__/walk.cpython-36.pyc -> build/lib/hy/contrib/__pycache__
    copying hy/core/bootstrap.hy -> build/lib/hy/core
    copying hy/core/language.hy -> build/lib/hy/core
    copying hy/core/macros.hy -> build/lib/hy/core
    copying hy/core/shadow.hy -> build/lib/hy/core
    creating build/lib/hy/core/__pycache__
    copying hy/core/__pycache__/__init__.cpython-36.pyc -> build/lib/hy/core/__pycache__
    copying hy/core/__pycache__/bootstrap.cpython-36.pyc -> build/lib/hy/core/__pycache__
    copying hy/core/__pycache__/language.cpython-36.pyc -> build/lib/hy/core/__pycache__
    copying hy/core/__pycache__/macros.cpython-36.pyc -> build/lib/hy/core/__pycache__
    copying hy/core/__pycache__/shadow.cpython-36.pyc -> build/lib/hy/core/__pycache__
    copying hy/extra/anaphoric.hy -> build/lib/hy/extra
    copying hy/extra/reserved.hy -> build/lib/hy/extra
    creating build/lib/hy/extra/__pycache__
    copying hy/extra/__pycache__/__init__.cpython-36.pyc -> build/lib/hy/extra/__pycache__
    copying hy/extra/__pycache__/anaphoric.cpython-36.pyc -> build/lib/hy/extra/__pycache__
    copying hy/extra/__pycache__/reserved.cpython-36.pyc -> build/lib/hy/extra/__pycache__
    running install_lib
    copying build/lib/hy/contrib/__pycache__/__init__.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/botsbuildbots.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/hy_repr.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/loop.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/multi.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/profile.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/sequences.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/contrib/__pycache__/walk.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/contrib/__pycache__
    copying build/lib/hy/core/__pycache__/__init__.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/core/__pycache__
    copying build/lib/hy/core/__pycache__/bootstrap.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/core/__pycache__
    copying build/lib/hy/core/__pycache__/language.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/core/__pycache__
    copying build/lib/hy/core/__pycache__/macros.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/core/__pycache__
    copying build/lib/hy/core/__pycache__/shadow.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/core/__pycache__
    copying build/lib/hy/extra/__pycache__/__init__.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/extra/__pycache__
    copying build/lib/hy/extra/__pycache__/anaphoric.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/extra/__pycache__
    copying build/lib/hy/extra/__pycache__/reserved.cpython-36.pyc -> /usr/local/lib/python3.6/site-packages/hy/extra/__pycache__
    copying build/lib/hy/version.py -> /usr/local/lib/python3.6/site-packages/hy
    byte-compiling /usr/local/lib/python3.6/site-packages/hy/version.py to version.cpython-36.pyc
    running install_data
    creating /usr/local/get_version
    error: could not create '/usr/local/get_version': Permission denied

    ----------------------------------------
Command "/usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/4j/n8nxnsy12y92t475g318yptm0000gn/T/pip-9yq8xr33-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 /var/folders/4j/n8nxnsy12y92t475g318yptm0000gn/T/pip-7aj73z0l-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/4j/n8nxnsy12y92t475g318yptm0000gn/T/pip-9yq8xr33-build/
@Kodiologist
Copy link
Member

Shouldn't that be sudo -H pip3 install hy?

@gwerbin
Copy link
Author

gwerbin commented Aug 2, 2017

@Kodiologist not with Homebrew on a Mac! To be fair it's acceptable in this kind of setup to chown -R $(whoami) /usr/local/. Which I did, and it installed fine.

Still, why should this install something directly to /usr/local and not, say /tmp? Is get_version.py required for Hy to run? Can I configure this somehow, e.g. with an environment variable?

@Kodiologist
Copy link
Member

Still, why should this install something directly to /usr/local and not, say /tmp?

No installation directories are named in setup.py, so this is likely a Pip setting.

Is get_version.py required for Hy to run?

No, it just generates hy/version.py.

Can I configure this somehow, e.g. with an environment variable?

Probably. Check Pip's documentation.

@refi64
Copy link
Contributor

refi64 commented Aug 2, 2017

Wait, this isn't right. Nothing should be installed into /usr/local directly like that, let alone something with the generic name generic_version...

@refi64 refi64 reopened this Aug 2, 2017
@refi64
Copy link
Contributor

refi64 commented Aug 2, 2017

Can't we use package_data for get_version.py?

@Kodiologist
Copy link
Member

No, or else get_version would have to be in the hy package, in which case importing it would import hy/__init__.py, leading to the import of several other files, and thus making it such that building the documentation would depend on the rest of Hy.

It's difficult for me to see how this could be our bug. That's why I closed the issue.

@refi64
Copy link
Contributor

refi64 commented Aug 3, 2017

99.9% of Unix systems have /usr as owned by root. Many login managers and other applications store configuration in /usr, so it's a security hazard to change the permissions of it in its entirety. (You also run into the issue of having writable directories in your path.)

To begin with, placing stuff in /usr is just as ugly as a global variable, especially if it's a file that's never going to actually be used.

TBH I'm pretty sure this can be solved with some distutils hackery. Messy, sure, but everyone does it anyway (!).

@gwerbin
Copy link
Author

gwerbin commented Aug 3, 2017

@kirbyfan64 this actually does look like an upstream bug. Try this minimal Python "package":

setup.py

import os, sys
from setuptools import setup
os.chdir(os.path.split(os.path.abspath(__file__))[0])

with open('hello.txt', 'w') as f:
    f.write('hello')

setup(
    name='tmp_pkg',
    version='0.0.1',
    data_files=[ ('hello', ['hello.txt']) ]
)

I get the same problem:

    running install_data
    creating /usr/local/hello
    error: could not create '/usr/local/hello': Permission denied

Setuptools' setup.py install_data is trying to install directly to /usr/local, which seems incorrect according to this comment: pypa/setuptools#130 (comment)

@refi64
Copy link
Contributor

refi64 commented Aug 3, 2017

Yes, yet the bug has been open for 10 months...

IMO regardless of whether or not data_files is broken, Hy still shouldn't fail installation.

@Kodiologist Kodiologist changed the title Installation problem -- how to fix? Installation failure with Homebrew Aug 3, 2017
@ionling
Copy link

ionling commented Feb 6, 2020

Same with me (macOS 10.15.1).

❯ pip3 install hy
Looking in indexes: https://pypi.doubanio.com/simple
Collecting hy
  Using cached https://pypi.doubanio.com/packages/f0/51/858ff15a2ff51243294aa13c6badd1edac938c1e7388b5d6dd44e22191f6/hy-0.18.0-py2.py3-none-any.whl
Requirement already satisfied: rply>=0.7.7 in /usr/local/lib/python3.7/site-packages (from hy) (0.7.7)
Requirement already satisfied: astor>=0.8 in /usr/local/lib/python3.7/site-packages (from hy) (0.8.1)
Requirement already satisfied: colorama in /usr/local/lib/python3.7/site-packages (from hy) (0.3.9)
Requirement already satisfied: funcparserlib>=0.3.6 in /usr/local/lib/python3.7/site-packages (from hy) (0.3.6)
Requirement already satisfied: appdirs in /usr/local/lib/python3.7/site-packages (from rply>=0.7.7->hy) (1.4.3)
Installing collected packages: hy
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/get_version'
Consider using the `--user` option or check the permissions.

But ok if I install hy by pipenv.

@Kodiologist
Copy link
Member

On the 5-year anniversary of this issue, I still don't think it should've been reopened. First, it's an upstream issue that we apparently can't do anything about. Second, we don't test on Mac OS, anyway, and nobody currently involved with Hy maintenance uses Mac OS, so there is approximately zero chance of this getting addressed in the foreseeable future. Let's put it to bed.

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

Successfully merging a pull request may close this issue.

5 participants