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

Should we print an error if --user and --target are used together? #7249

Closed
pradyunsg opened this issue Oct 21, 2019 · 3 comments · Fixed by #7777
Closed

Should we print an error if --user and --target are used together? #7249

pradyunsg opened this issue Oct 21, 2019 · 3 comments · Fixed by #7777
Labels
auto-locked Outdated issues that have been locked by automation C: target pip install's --target option's behaviour handling C: user scheme Handling of packages in user-specific directories state: awaiting PR Feature discussed, PR is needed type: enhancement Improvements to functionality

Comments

@pradyunsg
Copy link
Member

I wonder why we aren't also throwing if --target is provided.

No clue. Filing a new issue to track someone figuring this out. :)

Originally posted by @chrahunt in #7002

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Oct 21, 2019
@takluyver
Copy link
Member

If I try passing both, I get an error from distutils. It's pretty clear, so maybe this is why it's not checked in pip, but maybe it still makes sense to check it and fail faster.

$ pip install --user --target test-tgt/  astcheck
Collecting astcheck
  Using cached https://files.pythonhosted.org/packages/8d/a7/23752054ffc65eca77b2137f88c3b4b8d196112b5e13e9536f194ab67756/astcheck-0.2.5-py2.py3-none-any.whl
Installing collected packages: astcheck
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 179, in main
    status = self.run(options, args)
  File "/usr/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 421, in run
    strip_file_prefix=options.strip_file_prefix,
  File "/usr/lib/python3.7/site-packages/pip/_internal/req/__init__.py", line 57, in install_given_reqs
    **kwargs
  File "/usr/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 917, in install
    strip_file_prefix=strip_file_prefix,
  File "/usr/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 447, in move_wheel_files
    strip_file_prefix=strip_file_prefix,
  File "/usr/lib/python3.7/site-packages/pip/_internal/wheel.py", line 326, in move_wheel_files
    prefix=prefix,
  File "/usr/lib/python3.7/site-packages/pip/_internal/locations.py", line 180, in distutils_scheme
    i.finalize_options()
  File "/usr/lib64/python3.7/distutils/command/install.py", line 252, in finalize_options
    raise DistutilsOptionError("can't combine user with prefix, "
distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base

@chrahunt chrahunt added C: target pip install's --target option's behaviour handling C: user scheme Handling of packages in user-specific directories state: needs discussion This needs some more discussion type: enhancement Improvements to functionality labels Oct 21, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Oct 21, 2019
@chrahunt chrahunt added state: awaiting PR Feature discussed, PR is needed and removed state: needs discussion This needs some more discussion labels Nov 10, 2019
@chrahunt
Copy link
Member

This seems pretty straightforward, so changing status.

@sinscary
Copy link
Contributor

@pradyunsg I am on it. 👍

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Apr 2, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: target pip install's --target option's behaviour handling C: user scheme Handling of packages in user-specific directories state: awaiting PR Feature discussed, PR is needed type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants