Forced use of --allow-external and --allow-unverified very inconvenient and not very intuitive
See original GitHub issueRecently, I tried to install a module and got the following error message:
(virtualenv) C:\[snip]\trunk>pip install pypyodbc
Downloading/unpacking pypyodbc
Could not find any downloads that satisfy the requirement pypyodbc
Some externally hosted files were ignored (use --allow-external pypyodbc to allow).
Cleaning up...
No distributions at all found for pypyodbc
Storing debug log for failure in C:\Users\[snip]\pip\pip.log
I immediately tried to following command and was confused by the output:
(virtualenv) C:\[snip]\trunk>pip install --allow-external pypyodbc
You must give at least one requirement to install (see "pip help install")
A moment of Googling and reading some documention helped clear up the issue and I settled on this command rather than duplicate the package name:
(virtualenv) C:\[snip]\trunk>pip install --allow-all-external pypyodbc
Downloading/unpacking pypyodbc
Could not find any downloads that satisfy the requirement pypyodbc
Some insecure and unverifiable files were ignored (use --allow-unverified pypyodbc to allow).
Cleaning up...
No distributions at all found for pypyodbc
Storing debug log for failure in C:\Users\[snip]\pip\pip.log
At this point, I was rather annoyed, and I tried to use an “all” variant of the --allow-unverified
argument, which of course didn’t exist:
(virtualenv) C:\[snip]\trunk>pip install --allow-all-external --allow-all-unverified pypyodbc
Usage:
pip install [options] <requirement specifier> ...
pip install [options] -r <requirements file> ...
pip install [options] [-e] <vcs project url> ...
pip install [options] [-e] <local project path> ...
pip install [options] <archive url/path> ...
no such option: --allow-all-unverified
I finally got it to work with --allow-unverified pypyodbc
, but I feel this was a very poor user experience. I checked, and using --allow-unverified
by itself doesn’t work:
(virtualenv) C:\[snip]\trunk>pip install --allow-unverified pypyodbc pypyodbc
Downloading/unpacking pypyodbc
Could not find any downloads that satisfy the requirement pypyodbc
Some externally hosted files were ignored (use --allow-external pypyodbc to allow).
Having to type out both arguments seems unnecessarily bulky and tedious to me. I understand the value in having the ability to be more specific, but I suspect that in 99% of the use cases where this is an issue, users will want to bypass both. As such, there should be a combined argument that tells pip “I don’t care about the security right now. Just install this.” I haven’t come up with a good name for such an argument, but there should probably be individual and all variants of this argument. If users using such an argument with poor judgement is considered to be an issue, I would point out the “We’re all adults here” mentality set forth by the Python community.
Furthermore, I think the error message could be improved. It was not immediately obvious to me that the error message was suggesting I repeat the package name with the argument. It may be worthwhile to suggest an entire command line so that this is clear, or perhaps suggesting the all variant in addition to the package variant will make more clear that the package name is part of the argument.
Issue Analytics
- State:
- Created 10 years ago
- Comments:43 (13 by maintainers)
Top GitHub Comments
–allow-external never worker for me .
can someone please update this with how to solve this issue when specifying dependencies in setup.py?
moving to requirements.txt does not seem like a good solution since I don’t then understand how to specify dependencies for anything we have that depends on the package that moves to requirements.txt.
googling this issue continues to bring up this github thread which only discusses the ramifications, not the solution (for me anyway).