-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Forced use of --allow-external and --allow-unverified very inconvenient and not very intuitive #1423
Comments
I went through this too. More command line examples in the docs would have helped. |
I think it probably makes sense that if you specify As far as an |
I was completely stumped by this as well. When trying to pip install uwsgi==1.2.3:
and after I apparently got the allow-external part right
So I try all of the following:
and many more, until I finally figure out the way that works:
|
Yea sorry for the bad message- Part of that is because in some cases we can't tell if there's an unverified file available until after we've allowed external. But in 1.5.1 we'll be switching the message to give a full command, and we'll be switching it so |
Thanks 👍 |
The error message that pip gives should also give information about the
option in case a requirement file is being used. |
I think some examples of how to incorporate these flags into a requirements.txt file are also in order. I'm having quite a bit of trouble figuring it out, despite the comments in that other thread about it. (The trouble may be compounded by the fact that I have more than one requirement in the file.) In fact, it may be worth having a separate documentation page addressing these flags and potential ways of working with them (the reasoning behind them, how to use them at the command line, how to use them in a requirements file, potential risks, and possibly suggestion of downgrading if old behavior is needed). |
I updated the 1.5 docs 4047b4b |
Fixed in #1457 |
Is there an example of how to update an existing requirements.txt file? I have a long requirements filed pinned to specific versions of a large list of python packages, which now fails to install. What specifically do I need to add to get the versions I need to install installed? Looking at the docs file, it looks like I now have to go through each and every line of this file and find external packages for each package that fails, which is extremely time consuming. How do we get the exact old behavior? |
The only way to actually get the old behavior is to use an old version of pip. As a result of your comment, I have opened #1518. I believe this addresses the difficulty you're experiencing. Feel free to comment about concerns I haven't addressed there. |
Thanks for opening #1518, @bladeoflight16. I've also noticed that older versions of packages are failing under pip 1.5. See http://stackoverflow.com/questions/21386880/cant-install-old-versions-with-pip-anymore for an example of where the current version of the package works and an older one that previously worked now fails. Does this mean that whenever a package version goes out of date, the requirements.txt has to be changed to allow external and unverified? That seems like a maintenance nightmare for any project with more than a handful of packages installed. |
The requirement for |
@lsemel To elaborate on dstufft's response, what you could be describing is that some old versions of a package are hosted externally and insecurely, whereas newer versions are hosted non-externally and securely. This would represent a decision by the maintainers of the project (likely in response to this change in pip): they decided to host newer versions in a location that will not trigger this warning, but they opted not to move older versions to the same location. In this scenario, unless the maintainers decide to move all versions of the package to a new location, old versions will continue to require these arguments, whereas versions from now on (not just the newest one) will not. |
I am running into this annoyance as well. We have an internal private Python repo where we push all our libraries and apps. Some applications have more than one requirement, so specifying I would much rather white-list our entire private repo than do it manually for each package. Also, from our point of view, pypi is "external" and our own repo is "internal", yet it sees it as external... maybe |
What are you using for your internal repo? The external check I'd supposed to only activate if the repo has opted in to it (as PyPI does) to make it work for internal repos automatically. Perhaps there is a bug turning it on anyways.
|
Thanks for the quick reply :) It's just a simple apache web-listing (a remote folder exposed via Following this issue, I also just read your blog post discussing |
Yea something is wrong it sounds like. You're pointing to it with --find-links? Can you show me the html pip is accessing? You can email it to donald@stufft.io if you don't want to publish it. Also can you tell me the exact command you're typing. |
I was actually using The actual command to install the package was Given you post about the requirements file, I am considering re-thinking our deployment process. I understand the idea behind splitting abstract and concrete dependencies, but I dislike it so I avoided it until now. The actual HTML output looks something like this (cut out some parts for brevity):
|
If you have a simple pypi-ish internal mirror, you can use Then no need for dependency links. |
@Ivoz Agreed. This is also as far as I can remember the process used in our deployment scripts. I only happened to fall into this security issue, as I ran a manual installation on another host for testing. Our development process (as currently documented) still uses a Once pip 1.4 hits our machines, we'll have to update our process, and I just want to get my facts straight before this happens. It's a lazyness thing... typing |
I think there's a problem with dependency links and external detection. I'm traveling at the moment but I plan on taking a look at this this weekend and seeing what I can figure out. External url stuff should only take effect when you're installing from a repo that opts into it. So unless you've added the metatag, which it doesn't look like you have, this is a legit bug. I don't have the greatest editing environment right now, can you split this out into a new bug and CC me in it? |
@dstufft done. I hope the message is not overly vague... It's also not something of high importance to me. It will only impact our development environment when pip 1.5 hits our dev boxes which is not yet the case. Also, deployment scripts are fine too. So there's no immediate hurry. |
@exhuma note, you can also specify in a see http://www.pip-installer.org/en/latest/configuration.html#configuration You can also specify an alternative index in a |
Remove `dependency_links` since they cause issues with recent versions of `pip`, which require the specification of [`allow-external` and `allow-unverified`][1] for install to work properly for this package. In an effort to simplify things for the time-being, we simply list the dependencies and assume that they are installed, or available through PyPi. [1]: pypa/pip#1423
TL;DR: if you get errors for, say, 'egenix-mx-base', change your requirements.txt as follows: old:
new:
note that version id is not specified in the --allow-unverified line |
Is there any way to avoid repeating the package name for each and every Lee Semel On Wed, Mar 5, 2014 at 4:03 PM, bob pasker notifications@github.com wrote:
|
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). |
@mjallday I second your concern. I'm still not sure how to get an unverified package in a requirements flie. I've added --allow-all-external to my requirements install command (pip install --allow-all-external -r requirements.txt) but it still hangs on unverified packages. I'm non-plussed about this change to pip and while I appreciate the necessity of protecting us from malicious packages, there has to be a way to implement this that is not nearly so awkward. |
I would also add that in the interface, using "==" for package versions and "=" for the packages that are allowed unverified is confusing and has led to more than a few bugs on my end. All in all I would love for this whole external and unverified packages scheme to be completely rethought. If I can find the time I'll try to submit a pull request. |
A voice from a casual python user (I never inhale): And so probably I have not googled sufficiently to understand all of what is going on with pip 1.5.6, but I am not a sysadmin (excepting this one single sys here), and I don't install lots of different environments. Most often I install packages on an as-needed basis so that I can run various free/open-source sound and graphics applications that happen to be written in python. My needs are convenience and clarity so that I can go quickly from installing an application and/or its dependencies to using it. Virtually every python package I have needed ever has been hosted on pypi. This has not changed. This is my experience in a nutshell: Since updating pip, what used to look like this now must look like this to work edit: omygod. that did not actually work. I really need to replace that dark red in my terminal profile with something a little brighter. I will figure this out, but do you see what I am getting at? When this did not work: I found myself reading this thread because I was completely exasperated. The pip documentation online does not hint at the necessity of naming a single package three times for relatively simple installs like this one. Last week trying to use pip I think I gave up and decided to go do something else--I left no notes on how to deal with the sinking feeling that I recognized immediately on reading "Use --allow-external". Tonight though I had the energy to google. Obviously I have copied and pasted the working install command in my sysadmin cheat notepad for future reference, but, I don't know. Maybe my opinion carries no weight since I am but a dilettante when it comes to programming, but I can't be the only non-coder coder out here scratching my head. |
@erikjms I think the pip maintainers can agree although there was a clear aim in introducing these flags, the User Experience of the implementation wasn't thought through enough at the time and ended up being unnecessarily confusing. @dstufft @qwcode @pfmoore we should definitely discuss before 1.6 to make sure this has been improved. |
@Ivoz Thank you so much. I think this is all we were really asking for. |
So what's the currently recommended command to install an external pkg? edit: nevermind. have to have the name twice at the end.
To be perfectly honest, and not to hash over all the same arguments above, I wouldn't have a problem with this syntax if it were sensibly documented. |
allow-unverified option needs a package
|
I'm not sure why this was closed. This title of this ticket is still valid. |
I think the instructions were supposedly clarified, but I would agree @macropin |
@powellc I think the principle of least astonishment needs to be applied here... A simple |
Holy cow, I am still struggling install that damn |
@isbm Pretty sure that has nothing to do with pip. This StackOverflow question comes up fairly early in the Google results. If you have more difficulties, this really isn't the appropriate place to address them. Try one of the Stack Exchange sites. @macropin It was closed because a change was made so that |
@macropin: I agree. |
|
--allow-external never worker for me . |
They'll both be deprecated in a few weeks, as per http://legacy.python.org/dev/peps/pep-0470/ . |
Recently, I tried to install a module and got the following error message:
I immediately tried to following command and was confused by the output:
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:
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: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: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.
The text was updated successfully, but these errors were encountered: