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

distutils error when building pip_library rule #294

Closed
matthen opened this issue Mar 23, 2018 · 5 comments
Closed

distutils error when building pip_library rule #294

matthen opened this issue Mar 23, 2018 · 5 comments

Comments

@matthen
Copy link
Contributor

matthen commented Mar 23, 2018

I get an error on mac when trying to build a pip_library rule. I installed python and pip using homebrew. Below is a log:

~/projects £ git clone https://github.com/thought-machine/please-examples.git
Cloning into 'please-examples'...
remote: Counting objects: 214, done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 214 (delta 13), reused 28 (delta 9), pack-reused 174
Receiving objects: 100% (214/214), 41.36 KiB | 128.00 KiB/s, done.
Resolving deltas: 100% (60/60), done.
~/projects £ cd please-examples/
master ~/projects/please-examples £ plz --version
Please version 12.0.0
master ~/projects/please-examples £ plz build //third_party/python:protobuf
Build stopped after 5.53s. 2 targets failed:
    //third_party/python:_six#install
Error building target //third_party/python:_six#install: exit status 2
Exception:
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/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/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/wheel.py", line 247, in move_wheel_files
    prefix=prefix,
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/locations.py", line 153, in distutils_scheme
    i.finalize_options()
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/install.py", line 248, in finalize_options
    "must supply either home or prefix/exec-prefix -- not both")
distutils.errors.DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both

    //third_party/python:_protobuf#install
Error building target //third_party/python:_protobuf#install: exit status 2
Exception:
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/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/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/wheel.py", line 247, in move_wheel_files
    prefix=prefix,
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/locations.py", line 153, in distutils_scheme
    i.finalize_options()
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/install.py", line 248, in finalize_options
    "must supply either home or prefix/exec-prefix -- not both")
distutils.errors.DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both
@peterebden
Copy link
Member

Yup, I discovered this one the other day - there is an issue with the way Homebrew configures pip which results in this error.

There is a fix on master, I'm just waiting to resolve a couple of other issues before releasing a new version. I'll keep this issue open until then.

@matthen
Copy link
Contributor Author

matthen commented Mar 23, 2018

Thanks!

@matthen
Copy link
Contributor Author

matthen commented Mar 23, 2018

By the way, is it intended that the proto rules depend on having a build rule //third_party/python:proto? It seemed a bit odd that I have to create that, since the proto rules are included with please.

@peterebden
Copy link
Member

It's intended for now. A nicer solution in the longer term would be to be able to generate "one-off" rules somewhere so it did just appear. That's a little fiddly though since you often want to be able to control the version used, hence one reason why it hasn't happened yet.

@peterebden
Copy link
Member

This is fixed in 12.1.x

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