Pip install on windows is giving can not combine '--user' and '--target'

Viewed 2658

I am trying to run below commands but it's not working on my windows machine.

C:\Users\XXX\Desktop\python-7>pip install chalice -t .
ERROR: Can not combine '--user' and '--target'

C:\Users\XXX\Desktop\python-7>pip install --user --install-option="--prefix=" chalice -t .
ERROR: Can not combine '--user' and '--target'

Can someone please let me know if there is any alternative to get the module in the same directory ?

UPDATE

C:\Users\XXX\Desktop\python-7>pip install --target=C:\Users\XXX\Desktop\python-7 chalice
ERROR: Can not combine '--user' and '--target'
3 Answers

This happens with the Python version distributed on the Windows AppStore.

I believe it's because that version installs the basic executables under C:\Program Files\WindowsApps, a secured location that users cannot modify; pip is then aliased to actually run as something like pip --user C:\Users\<your_user>\AppData\Local\Packages\PythonSoftwareFoundation.Python.<version>_<id>\LocalCache\local-packages\Python<version>, so users will install packages to a writeable folder.

Hence, as soon as you try to add --target, pip breaks.

add --no-user at the end of the command and it should work

You can simply use:

C:\Users\XXX\Desktop\python-7>pip install chalice

Related