Skip to content Skip to sidebar Skip to footer

PIP Install: Cannot Combine --user And --target

My goal is to install a package to a specific directory on my machine so I can package it up to be used with AWS Lambda. Here is what I have tried: pip install snowflake-connector-

Solution 1:

We encountered the same issue when running pip install --target ./py_pkg -r requirements.txt --upgrade with Microsoft store version of Python 3.9.

Adding --no-user to the end of it seems solves the issue. Maybe you can try that in your command and let us know if this solution works?

pip install --target ./py_pkg -r requirements.txt --upgrade --no-user


Solution 2:

We had the same issue just in a Python course: The error comes up if Python is installed as an app from the Microsoft app store. In our case it was resolved after re-installing Python by downloading and using the installation package directly from the Python website.


Solution 3:

I got a similar error recently. Adding my solution so that it might help someone facing the error due to the same reason.

I was facing an issue where all my pip installed packages were going to an older python brew installation folder.

As part of debugging, I was trying to install awscli-local package to user site-package using:

pip install --user awscli-local

Then I got: ERROR: cannot combine --user and --target

In my case, it was due to the changes in pip config I had set some time back for some other reason. I had set the 'target' config globally - removing which removed this error and my actual issue I was debugging for.


Check the following if solutions given above doesn't resolve your issue:

try the command: pip config edit --editor <your_text_editor>

For me: pip config edit --editor sublime

This will open the current config file where you can check if there's any conflicting configuration like the 'target' set in my case.


Post a Comment for "PIP Install: Cannot Combine --user And --target"