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

pip_install(["--platform linux_x86_64"] running pip wheel and result in no such option: --platform linux_x86_64 #68

Closed
kchodnicki opened this issue Jan 13, 2022 · 1 comment

Comments

@kchodnicki
Copy link

I have the identical issue as explained here: bazelbuild/rules_python#260 (comment) and I'm trying to implement the suggestion from here: bazelbuild/rules_python#260 (comment).

My WORKSPACE:

## PIP install libs for python
http_archive(
    name = "com_github_ali5h_rules_pip",
    strip_prefix = "rules_pip-3.0.0",
    sha256 = "630a7cab43a87927353efca116d20201df88fb443962bf01c7383245c7f3a623",
    urls = ["https://github.com/ali5h/rules_pip/archive/3.0.0.tar.gz"],
)

load("@com_github_ali5h_rules_pip//:defs.bzl", "pip_import")

pip_import(
    name = "pip_deps",
    requirements = "//third_party/python_requirements:requirements.txt",
    python_interpreter="python3",
)

load("@pip_deps//:requirements.bzl", "pip_install")
pip_install(["--platform linux_x86_64", "--only-binary", ":all"])

Unfortunately, I get the following error:

INFO: Repository pypi__39__grpcio_1_37_1 instantiated at:
  /.../WORKSPACE:98:12: in <toplevel>
  /private/var/tmp/.../e3523c944af0bdd86cccbc59a8209df1/external/pip_deps/requirements.bzl:85:16: in pip_install
Repository rule whl_library defined at:
  /private/var/tmp/.../e3523c944af0bdd86cccbc59a8209df1/external/com_github_ali5h_rules_pip/defs.bzl:126:30: in <toplevel>
ERROR: An error occurred during the fetch of repository 'pypi__39__grpcio_1_37_1':
   Traceback (most recent call last):
	File "/private/var/tmp/.../e3523c944af0bdd86cccbc59a8209df1/external/com_github_ali5h_rules_pip/defs.bzl", line 124, column 13, in _whl_impl
		fail("whl_library failed: %s (%s)" % (result.stdout, result.stderr))
Error in fail: whl_library failed:  (
Usage:
  whl.py install [options] <requirement specifier> [package-index-options] ...
  whl.py install [options] -r <requirements file> [package-index-options] ...
  whl.py install [options] [-e] <vcs project url> ...
  whl.py install [options] [-e] <local project path> ...
  whl.py install [options] <archive url/path> ...

no such option: --platform linux_x86_64
)

I'm confused why the argument is being passed (as it seems) to pip wheel and not only pip install.

How should I solve this issue?

@ali5h
Copy link
Owner

ali5h commented Jan 13, 2022

it should be pip_install(["--platform", "linux_x86_64", "--only-binary", ":all"])

@ali5h ali5h closed this as completed Jan 13, 2022
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