0

I played around with configuring a private pip repository in a virtual environment that I regularly use. Something has happened and now whenever I try to use pip in this virtualenv i get this error:

    # pip install psutil

    Usage:
      pip install [options] <requirement specifier> [package-index-options] ...
      pip install [options] -r <requirements file> [package-index-options] ...
      pip install [options] [-e] <vcs project url> ...
      pip install [options] [-e] <local project path> ...
      pip install [options] <archive url/path> ...

    <username for private repo> is not a valid value for user option, please specify a boolean value like yes/no, true/false or 1/0 instead.

The error is not particularly helpful because i have no idea where this string is being input. To my knowledge I didn't change any sort of configuration file. how can i recover this virtual environment to make it usable again?

smokes2345
  • 190
  • 1
  • 12
  • I even get this error if i use `python -m pip...` – smokes2345 May 18 '20 at 21:00
  • There are a few other options to [re]install pip: https://stackoverflow.com/questions/26279207/installing-pip-using-easy-install That might help. – Prateek Dewan May 18 '20 at 21:05
  • 1
    Seems like it's trying to apply the string `` as a value for the `--user` option. Could anything in your environment be doing that? Also, what happens if you just run `pip` (or `python -m pip`) without any further arguments? – tzaman May 18 '20 at 21:07

1 Answers1

0

This particular problem presented as a part of a docker image build. The problem ended up stemming from the fact that I was passing the username and password into the build process as environment variables. I was then using those variables on the command line like...

pip install https://$PIP_USER:$PIP_PASS@...

but pip was picking up those variables on its own and applying them to pre-defined arguments that I didn't intend to pass. The solution was to change the name of the variables.

smokes2345
  • 190
  • 1
  • 12