-
Notifications
You must be signed in to change notification settings - Fork 968
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
Ensure the new pipenv tutorial works on Windows #373
Comments
When I get back from vacation I'll also run through this on a clean windows
machine.
…On Thu, Aug 31, 2017, 11:53 PM Nick Coghlan ***@***.***> wrote:
https://packaging.python.org/new-tutorials/installing-and-using-packages/#installing-pipenv
covers amending PATH to handle user script installations, but the directory
isn't $USER_BASE/bin on Windows, it's $USER_BASE/Scripts (I think)
@pfmoore <https://github.com/pfmoore> Would you be able to take a look
through
https://packaging.python.org/new-tutorials/installing-and-using-packages/
and check for any *nix-specific details?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#373>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAPUczfDK49RN5EYJhRYUmB8qzHZY3yLks5sd3_GgaJpZM4PJrTA>
.
|
The instructions for adding the user site directory are wrong on Windows:
You actually need to add the Two issues with pipenv. Sorry I don't have time at the moment to report them to the project or follow up with helping them address the issues:
The final line of the output of |
Adding @kennethreitz to the thread, as some of @pfmoore's comments above relate to |
I think the suggestion of recommending As part of creating https://github.com/ofek/pybin, @Okef also found this detailed tutorial on updating the System PATH in the Java docs: https://www.java.com/en/download/help/path.xml However, looking more closely at that, I don't think it's one we want to reference ourselves, since it doesn't cover updating the user PATH (which is what we want people to adjust). |
Yeah that sounds good ( I don't have a good feel for how to advise people on updating PATH, as I know too much to be a good test case for that ;-) What I will say is that I've never had much problem with colleagues needing to update paths - if they don't know they typically either google, or ask someone around them, or muddle through. |
@pfmoore can you open issues at https://github.com/kennethreitz/pipenv? we'll be happy to get a patch out asap. |
FWIW, the python installation guides here instruct users on how to update their path accordingly. |
@pfmoore landed a fix in master that fixes the warning you saw. thanks for the report! Also got basic windows test coverage up and running today, again. Work in progress still, but it's better than nothing :) |
Will remove the ✨ 🍰 ✨ on windows next. Unfortunate, because it works in better terminal emulators, (like cmder). but it is what it is. |
okay, removed ✨ 🍰 ✨ from windows. will be in the next release. |
v5.3.1 released, which includes these changes! |
@kennethreitz Thanks, and apologies for not being able to follow up with issues as requested - life's been pretty busy lately. |
Okay, it seems the outstanding issues with the guide itself is just the |
If I can be of any help, let me know! Have a fresh windows machine sitting right here. |
@kennethreitz If you wanna run through it yourself, PRs are happily accepted. :) (I'm fresh back from vacation, so I gotta bury myself out of email and peer reviews before I can get to this) |
What's the expectation on when this guide will go live? I've just tried pipenv "for real" for the first time, and there are some issues I've had that made for what I felt was a bit of a confusing experience once I got past the very basic I'm wondering what's the best way to ensure that when it does go in, users have a good experience with it, in terms of knowing where they go when their needs go beyond what's covered here. I'm happy to discuss the specifics of my experience, just not sure where the best place to do so would be. |
@pfmoore I was planning on doing the final touches to the pipenv guide and moving it to be the new tutorial during my block of hours on Friday.
This is totally valid (and useful). I'd be really interested in hearing your thoughts.
Here is fine. I suppose I could also hop in IRC sometime. |
@jonparrott I'm happy with here. In the first instance it probably makes sense to document what I did and why, and how it caused me to stumble. That's easier in this format than IRC (which I don't normally use, but can if it helps). We can then work out where to go from there. I assume @kennethreitz will probably be interested too, and if he prefers to take this somewhere else (e.g., specific issues on the pipenv tracker) then I'm OK with that too. I'll do a write-up later this evening. |
Cool - if it's easier for you feel free to write up a "friction log" using google docs or send it over via PR so we can comment/review/discuss. |
The situation I was in, is that I was setting up for a new piece of work, analyzing data. It's an exploratory project rather than a "build an application" type of thing, typical (as I understand it) of many data science types of project. I wanted to maintain the project environment in a virtualenv, and it seemed like pipenv would be a good tool to use, for various reasons - as a learning exercise (I've never used it before), because it's going to be the recommended approach in future, because it handles "incremental" installs (just do The first package I needed was cassiopeia which gets game data for League of Legends via the Riot API. So I started my project with What I decided I wanted to do was to store the downloaded wheel in my project under a "wheels" directory, and direct pipenv to install from there. So I was now off to look for how to do that. I went to look in the pipenv documentation (one minor stumbling block here - the "Further documentation guides" for pipenv are a long way down the main page, after "User testimonials", which I normally expect near the end, so for a while I totally missed the fact that there were more docs than the simple "install, use I managed in the end to get pycurl installed by temporarily setting (Using Next problem was that I needed to install However, I then hit a problem with a dependency, So I finally ended up with something that worked, mostly. I didn't feel that confident in the result, though, and I honestly feel I'd have been better with a simple requirements file and There's a fair amount of the above that's a cosnequence of problems installing cassiopeia. And that's not pipenv's fault. Personally, though I found that confusion over what pipenv was doing made my problems worse not better. I can't say that a complete newcomer would feel the same - it's easy for me to say that making a requirements file is simple enough, but it may well be just as much a problem for a newcomer as pipenv was. And of course, pipenv is still relatively new, and I'm 100% confident that as time goes on, this sort of thing will get ironed out resulting in a much nicer experience. One final annoyance - OK. So that's my experience with pipenv on a real project. Mostly a result of a fairly problematic package to install, and I doubt any tool I was new to using would have fared that much better. And there's nothing here that can't be dealt with. But it might be worth making sure that if this is our recommended approach going forward, we include some advice on how to troubleshoot situations like this. As I say, there's not a lot actionable in the above, but maybe we could include a FAQ covering points like:
Hopefully, some of this is useful. If I can do anything to clarify any of the points here, or help with any documentation improvements that seem worthwhile, I'll be happy to do so. |
I think there are two potential paths to go down here, since Option 1 is to simply say for these cases "Use the Option 2 is to propose that However, I don't think |
Hmm, if that's the case, then there's no indication of that fact in either pipenv's documentation or ours. Something like "if you need to use packages that are not hosted on a public index server like PyPI, then you should use (alternative approach)" would be useful - although do we have a recommended alternative approach? While more and more packages (particularly in the scientific stack) seem to be getting binary wheels on PyPI, people getting directed to Christoph Gohlke's set of wheel builds on Windows is still a very common situation. Having to say to people "grab the wheel from Christoph's site - oh, and change your development workflow to stop using the recommended pipenv approach" isn't exactly ideal :-( (And yes, I do think that discovering or adding a new dependency part way through development is common enough to warrant consideration in a "beginners" tutorial. Option 1 - I don't consider packages that don't provide their own wheels as "automation unfriendly". It's easy to automate the way I describe (include the wheel in the archive, and install via Option 2 - agreed that if Christoph's archive were available as a PyPI-style index, this would not be an issue. My understanding from what I've heard in the past is that he's unwilling to do this, but I don't know why, so that's something that as you say would have to be handled via non-technical channels. (AIUI, pipenv does support extra indexes, so it wouldn't even need a change to pipenv in that case).
A couple of points here.
Once again, I'm not arguing against pipenv - it looks like a very cool approach, and I look forward to being able to use it for all my projects. But I do think it may be a little premature to recommend it to the extent that this tutorial currently does. There's a strong argument that recommending it gets more users, hence more feedback, which is a good thing. But my experience was that I ended up sufficiently confused that I didn't feel able to give really constructive feedback, and that's a problem. |
And I guess that's the key purpose of the issue: prior PyPA experience with So if there's a showstopper UX problem, there's a showstopper UX problem, and we need to work out how to deal with that, rather than try to pretend it isn't a problem and proceed with the recommendation anyway. |
@pfmoore Is there something that can be placed in a If so, I'm thinking this may be amenable to a config file based approach: https://pip.pypa.io/en/stable/user_guide/#config-file Essentially, we'd tell folks "If you need access to extra wheel files that aren't published on PyPI, adjust your user level |
I think the key thing that needs to be clear is what the core use cases for pipenv are. My naive expectation was that it was intended to handle the various use cases that pip does:
If that is the intention, then the problem's simple - not all the functionality is implemented yet. If the expectation is that certain things shouldn't be handled via pipenv, then there's a need to define scope, consider how projects migrate when they need to go beyond the boundaries of pipenv's scope, etc.
Yes, but that has the same problem as the environment variable - it's unknown to pipenv and cannot be stored with the project, so copying the project to another machine (something I do a lot) needs out-of-band information on how to configure things so it'll work. For me, the huge plus of pipenv is that you just take the project directory, and everything you need is present. Environment management is all handled by a simple |
I should also say that this isn't really for us to say. Ultimately, it's a question for the @kennethreitz and the pipenv developers. We should only be documenting how to use the tool within its scope, and how to recognise when it's not appropriate for a given situation. |
I wouldn't expect So I see two parts to this UX concern:
For non-Windows machines, the answers to those two questions are:
Beyond that, we don't really worry about it - if the platform package manager isn't considered adequate, folks can always opt for something like Those answers aren't great on Windows, since we can't assume that getting things installed at the interpreter level will be any easier than getting them installed into the virtual environment. The UCI/Gohlke wheel files exist, but aren't currently amenable to automated installation (hence the idea of getting Mark to ask if that's just a bandwidth management problem that the PSF could help with - I'll bring that up with the Packaging Working Group). As an interim measure though, it would be nice if there was a way to say "Save the wheel files you want to use to a local directory" and "Tell pip[env] where that supplemental wheel directory is" (as you did with PIP_FIND_LINKS). The UX request for |
Specifically, the section of If that permitted |
Absolutely. That's where I expected to find the information. And regarding reproducibility, I think you're missing my point (or consider it "advanced" usage) that I planned on holding the required wheels within the project directory and installing them from there. That effectively makes for a 100% reproducible setup. With that in mind, I think that "support installations from artifacts stored within the project directory" is a completely reasonable expectation for pipenv (albeit one they may not wish to address - that's up to them), and far less controversial than "support installations from arbitrary local locations". Also, I don't personally think that using system-installed libraries is something we should be expecting as a component of our recommended workflow. Isolation of project environments is way too important for that to be a good idea. (That's an opinion borne of years of bitter experience dealing with juggling wininst installers on Windows...) |
Oh, I'd misunderstood what you were suggesting - I thought you were expecting to be able to use wheels from arbitrary host directories. I think that makes even more sense as a
|
Yep, precisely that. That seems like a really nice enhancement, and totally in line with how pipenv works. I'll add that specific suggestion to the issue I opened over there, as it expresses what I want far better than I did. |
Relevant pipenv issue: https://github.com/kennethreitz/pipenv/issues/914 |
Okay - so are we okay to move forward with promoting to this to top-level tutorial? I plan to amend the bottom of the tutorial to link to the pip/virtualenv flow as well as mention conda for scientific packages. |
Personally, I think it's premature. I found trying to use pipenv on a project fairly confusing as soon as I hit a dependency that wasn't trivially installable from PyPI. At that point, neither this guide, nor the pipenv docs, really offer any useful guidance, and I ended up needing to abandon pipenv in favour of pew plus It is possible this is just me having a bad experience. I think we should get a few more opinions. |
I honestly don't know. I've been thinking about it, and while there is a missing feature (some equivalent of pip's
In workflow, there's also the questions around whether people should live in a Also, some things in pipenv are just obscure. It took me a long time to find |
I do want to do this, similar to what we have now for pip and virtualenv. I was planning on doing this post-cut-over but happy to block on that. |
For the
And then one more platform specific one:
As far as a day-to-day workflow goes, I definitely recommend So folks certainly can use |
@ncoghlan Thanks for the explanations. I guess I'm still unclear (as a consumer of this guide) why I should care about pinning, and what effect it'll have on me. If I'm developing something like a data analysis project (the actual situation I tried out pipenv for) I just want the current version of the library that gets my data from its source. If I check my project into github, should I check in just I understand if I'm building an application for deployment, I need to think about making sure I release exactly what I tested. But in my mind, that's more "advanced" use than simply knocking up a script for personal use, or for sharing with my peers, which is where I, personally need a simple environment management process (and it's where colleagues struggle with "how do I do this?" and end up installing stuff into their system Python "because it's what the installation instructions said to do"). I'd have expected people doing full application deployment to have (or be developing) workflows and standards for this, so while the tutorial would give them a starting point, it's not what I'd expect them to use without understanding the options. |
Also, I guess the other question (from people familiar with older approaches) is, what is the recommended approach to replace PS - although I work with pip/virtualenv a lot, I do consider myself a "beginner" when it comes to development workflows. I'm only just starting to go beyond the stdlib for anything I'd be willing to consider as reusable for "real work", so this is genuinely really important to me, and I honestly do feel that I'm the target audience for this guide. |
You should check in By contrast, if you only check in While While the dependency pinning approach avoids dependency updates randomly breaking your stuff, it does carry some risks in terms of continuing to use old versions with known security flaws. To mitigate that, pipenv includes the I'll also note that the difference between runtime dependencies and dev dependencies is another distinction that |
OK. I'm not 100% comfortable with that view, but that's not the point here. If the tutorial explained the background and recommended approach, and how pipenv supports that approach, that would help a lot. Again, task based examples (I want to develop a library, I want to develop a standalone application, I'm writing an adhoc script to be shared with others, I'm working on a data analysis project, ...) would help here, as I don't think the priorities are the same for all of them. The trick is not to overwhelm the user with choices of course, while not accidentally leading them into a workflow that's not appropriate for them. |
OK, thinking some more about this, the following are actual tasks I needed to do when working on my current project. They were all things that the library I was using needed, and they are pretty typical things to do, from my experience and what I've seen from others.
So that's more or less the sort of thing I'd like to see in the tutorial. I'd be happy to work this up into a PR, but at the moment it's somewhat more questions than answers, plus a scattering of "this is suboptimal" comments, and I'd like a PR to be more positive than this ;-) [*] Technically, the pip docs don't mention omitting the I think I've said all I can now from my experiences trying out pipenv, so I'll leave things here, for others to decide how to take this further. |
Thanks @pfmoore for your detailed feedback. It seems (1) is covered by the tutorial and it seems reasonable to add (4) and (5) to the tutorial directly. For (2) and (3) I think those are best covered in a separate guide (something like "Using pipenv for advanced use cases"). I will try to address all of this during my next set of hours here. :) |
Thanks @jonparrott Personally, I still don't think I'll recommend pipenv to newcomers yet. But hopefully it'll improve as additional feedback is generated from the people introduced to it by this tutorial. |
Hey @jonparrott I followed you over here from Pipenv (I am a maintainer) where we had support for local files which was regressed somewhere. We actually maintained that support and still have it as long as the local files are in the top level project path, but the requirements parser library we use errors out if you pass in anything like a directory separator. I just pushed a working fix for this regression as well as some tests to catch it going forward, so that pipfiles can house local paths relative to the project directory (see kennethreitz/pipenv#540 for the initial discussion on this). I would say that, from a maintainer perspective, if having a wheel directory as a source option is critical I assume we can discuss it further. As a user who has deployed on windows (sometimes), however, and is a reasonably advanced user of pip, I have never actually used this flag. I don't think it is something most novice users actually need as part of their normal python usage, since as was mentioned most people will just download the applicable wheels and ship it in a local artifacts directory. |
@pfmoore As a couple of examples of reasons I think recommending a higher level tool by default is valuable, look into You can do that kind of thing yourself if you want to, but with |
https://packaging.python.org/new-tutorials/installing-and-using-packages/#installing-pipenv covers amending PATH to handle user script installations, but the directory isn't
$USER_BASE/bin
on Windows, it's$USER_BASE/Scripts
(I think)@pfmoore Would you be able to take a look through https://packaging.python.org/new-tutorials/installing-and-using-packages/ and check for any *nix-specific details?
The text was updated successfully, but these errors were encountered: