{"post_stream":{"posts":[{"id":4882,"name":"Chad Smith","username":"cs01","avatar_template":"/user_avatar/discuss.python.org/cs01/{size}/612_2.png","created_at":"2019-03-01T01:52:44.285Z","cooked":"\u003cp\u003eI came across this PEP a few weeks ago and thought it was really interesting. I wrote a \u003ca href=\"https://medium.com/@grassfedcode/goodbye-virtual-environments-b9f8115bc2b6\" rel=\"noopener nofollow ugc\"\u003eblog post\u003c/a\u003e about it and a proof of concept called \u003ca href=\"https://github.com/cs01/pythonloc\" rel=\"noopener nofollow ugc\"\u003epythonloc\u003c/a\u003e. Overall I like the idea, but I think some minor implementation changes can have big changes on how useful and adopted this feature becomes. I wanted to share some of my feedback here.\u003c/p\u003e\n\u003ch2\u003e\u003ca name=\"p-4882-falling-back-to-site-packages-reduces-usefulness-of-__pypackages__-1\" class=\"anchor\" href=\"#p-4882-falling-back-to-site-packages-reduces-usefulness-of-__pypackages__-1\" aria-label=\"Heading link\"\u003e\u003c/a\u003eFalling back to \u003ccode\u003esite-packages\u003c/code\u003e reduces usefulness of \u003ccode\u003e__pypackages__\u003c/code\u003e\u003c/h2\u003e\n\u003cp\u003eIf I am developing an app or library and I want to test it, I need to know exactly which packages are available. For example, if I blow away \u003ccode\u003e__pypackages__\u003c/code\u003e, then run \u003ccode\u003epip install .\u003c/code\u003e and try to run my code, I cannot guarantee all my dependencies came from that \u003ccode\u003epip install .\u003c/code\u003e; some could have been in the fallback location of \u003ccode\u003esite-packages\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eSo because I am not 100% certain which libraries are being used, I basically can’t use it for development. Almost everyone, including tools like Pipenv and poetry, will still have to use virtual environments to guarantee deterministic package resolution.\u003c/p\u003e\n\u003cp\u003eI suggest \u003cstrong\u003eonly\u003c/strong\u003e searching \u003ccode\u003e__pypackages__\u003c/code\u003e if that directory is found. If that is done, then many more people can stop using virtual environments if they choose to.\u003c/p\u003e\n\u003ch2\u003e\u003ca name=\"p-4882-namespacing-of-packages-in-__pypackages__-does-not-include-os-2\" class=\"anchor\" href=\"#p-4882-namespacing-of-packages-in-__pypackages__-does-not-include-os-2\" aria-label=\"Heading link\"\u003e\u003c/a\u003eNamespacing of packages in \u003ccode\u003e__pypackages__\u003c/code\u003e does not include OS\u003c/h2\u003e\n\u003cp\u003eOne of the really nice things about this is that the directory structure can be copied directly and run on different machines. However, if code gets copied from a windows machine to linux server and attempted to run, it may fail (with cryptic error messages) due to OS differences. I suggest namespacing on Python version as well as os, such as \u003ccode\u003e__pypackages__/windows/3.6/...\u003c/code\u003e.\u003c/p\u003e\n\u003ch2\u003e\u003ca name=\"p-4882-running-binaries-or-scripts-3\" class=\"anchor\" href=\"#p-4882-running-binaries-or-scripts-3\" aria-label=\"Heading link\"\u003e\u003c/a\u003eRunning binaries or “scripts”\u003c/h2\u003e\n\u003cp\u003eWhen installing a package with entry points, they get buried somewhere in \u003ccode\u003e__pypackages__\u003c/code\u003e. The node/JavaScript world has a similar problem, and they solved it with a tool called \u003ca href=\"https://www.npmjs.com/package/npx\" rel=\"noopener nofollow ugc\"\u003enpx\u003c/a\u003e which\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eexecutes  either from a local node_modules/.bin, or from a central cache, installing any packages needed in order for  to run.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eI updated \u003ca href=\"https://github.com/pipxproject/pipx\" rel=\"noopener nofollow ugc\"\u003epipx\u003c/a\u003e to work similarly (i.e. \u003ccode\u003epipx run flake8\u003c/code\u003e, or to \u003cem\u003eonly\u003c/em\u003e search \u003ccode\u003e__pypackages__\u003c/code\u003e and not a temporary installation, \u003ccode\u003epipx run --pypackages flake8\u003c/code\u003e). pipx doesn’t have to be the only solution, but a simple program that can determine the expected local \u003ccode\u003ebin/\u003c/code\u003e dir can fill this function. For example, poetry or Pipenv could have this functionality added.\u003c/p\u003e\n\u003ch2\u003e\u003ca name=\"p-4882-installinguninstalling-from-__pypackages__-4\" class=\"anchor\" href=\"#p-4882-installinguninstalling-from-__pypackages__-4\" aria-label=\"Heading link\"\u003e\u003c/a\u003eInstalling/Uninstalling from \u003ccode\u003e__pypackages__\u003c/code\u003e\u003c/h2\u003e\n\u003cp\u003eThe PEP is a little hand-wavey on how this will work and mentions pip adapting to it.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eAfter doing a fresh check out the source code, a tool like pip can be used to install the required dependencies directly into this directory.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cblockquote\u003e\n\u003cp\u003eIn another example scenario, a trainer of a Python class can say “Today we are going to learn how to use Twisted! To start, please checkout our example project, go to that directory, and then run python3 -m pip install twisted.”\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eIn theory, this sounds great. \u003ccode\u003epip\u003c/code\u003e will be modified to install to \u003ccode\u003e__pypackages__\u003c/code\u003e (by default?). And if a user wants to install to \u003ccode\u003esite-packages\u003c/code\u003e or their user dir, they can use appropriate flags. However, this is a big change in behavior for pip. Are pip maintainers on board with this? The adoption of the \u003ccode\u003e__pypackages__\u003c/code\u003e convention depends not only on Python running from that directory but on how easy it is to manipulate packages in it too.\u003c/p\u003e\n\u003ch2\u003e\u003ca name=\"p-4882-freezability-5\" class=\"anchor\" href=\"#p-4882-freezability-5\" aria-label=\"Heading link\"\u003e\u003c/a\u003eFreezability\u003c/h2\u003e\n\u003cp\u003eAlong the the lines of the last section, being able to create a lockfile of everything in \u003ccode\u003e__pypackages__\u003c/code\u003e would be incredibly useful to the community. I’m not sure this is possible with current tooling, but this use case should definitely be considered.\u003c/p\u003e","post_number":1,"post_type":1,"posts_count":445,"updated_at":"2019-03-01T18:36:00.457Z","reply_count":2,"reply_to_post_number":null,"quote_count":0,"incoming_link_count":11137,"reads":449,"readers_count":448,"score":55994.8,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Chad Smith","primary_group_name":null,"flair_name":null,"flair_url":null,"flair_bg_color":null,"flair_color":null,"flair_group_id":null,"badges_granted":[],"version":5,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"link_counts":[{"url":"https://medium.com/@grassfedcode/goodbye-virtual-environments-b9f8115bc2b6","internal":false,"reflection":false,"title":"Goodbye Virtual Environments? – Chad Smith – Medium","clicks":142},{"url":"https://github.com/cs01/pythonloc","internal":false,"reflection":false,"title":"GitHub - cs01/pythonloc: drop-in Python replacement that imports packages from local directory (attempt at PEP 582 implementation)","clicks":122},{"url":"https://github.com/pipxproject/pipx","internal":false,"reflection":false,"title":"GitHub - pipxproject/pipx: execute binaries from Python packages in isolated environments","clicks":28},{"url":"https://www.npmjs.com/package/npx","internal":false,"reflection":false,"title":"npx - npm","clicks":8},{"url":"https://discuss.python.org/t/pep-704-require-virtual-environments-by-default-for-package-installers/22846/155","internal":true,"reflection":true,"title":"PEP 704 - Require virtual environments by default for package installers","clicks":10},{"url":"https://discuss.python.org/t/structure-of-the-packaging-strategy-discussions/23478/43","internal":true,"reflection":true,"title":"Structure of the Packaging Strategy Discussions","clicks":0}],"read":true,"user_title":null,"bookmarked":false,"actions_summary":[{"id":2,"count":9}],"moderator":false,"admin":false,"staff":false,"user_id":444,"hidden":false,"trust_level":1,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/1","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null,"can_vote":false},{"id":4887,"name":"Paul Moore","username":"pf_moore","avatar_template":"/user_avatar/discuss.python.org/pf_moore/{size}/35_2.png","created_at":"2019-03-01T09:27:14.083Z","cooked":"\u003cp\u003e(BTW, there’s a typo in your subject - it’s PEP 582, not 528)\u003c/p\u003e\n\u003caside class=\"quote no-group\" data-username=\"cs01\" data-post=\"1\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.python.org/cs01/48/612_2.png\" class=\"avatar\"\u003e cs01:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eAre pip maintainers on board with this?\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003ePersonally, no. I like the idea in principle, but in practice, as you say, it seems like a pretty major change in behaviour and something I’d expect to be thrashed out in \u003cem\u003efar\u003c/em\u003e more detail before assuming it’ll “just happen”.\u003c/p\u003e\n\u003cp\u003eHaving said that, \u003ca class=\"mention\" href=\"/u/dstufft\"\u003e@dstufft\u003c/a\u003e is one of the authors, so I assume he was on board with the assumptions being made here, and can probably clarify better than I can.\u003c/p\u003e","post_number":2,"post_type":1,"posts_count":445,"updated_at":"2019-03-01T09:27:14.083Z","reply_count":0,"reply_to_post_number":null,"quote_count":1,"incoming_link_count":34,"reads":297,"readers_count":296,"score":244.4,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Paul Moore","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"CPython core developer","title_is_group":true,"bookmarked":false,"actions_summary":[{"id":2,"count":1}],"moderator":false,"admin":false,"staff":false,"user_id":35,"hidden":false,"trust_level":3,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/2","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4900,"name":"Brett Cannon","username":"brettcannon","avatar_template":"/user_avatar/discuss.python.org/brettcannon/{size}/34895_2.png","created_at":"2019-03-01T19:56:06.508Z","cooked":"\u003cp\u003e\u003ca href=\"https://www.python.org/dev/peps/pep-0582/\"\u003ePEP 582\u003c/a\u003e for a convenient link.\u003cbr\u003e\n\u003ca class=\"mention\" href=\"/u/kushaldas\"\u003e@kushaldas\u003c/a\u003e \u003ca class=\"mention\" href=\"/u/steve.dower\"\u003e@steve.dower\u003c/a\u003e \u003ca class=\"mention\" href=\"/u/dstufft\"\u003e@dstufft\u003c/a\u003e \u003ca class=\"mention\" href=\"/u/ncoghlan\"\u003e@ncoghlan\u003c/a\u003e so they know about this topic.\u003c/p\u003e\n\u003caside class=\"quote no-group\" data-username=\"cs01\" data-post=\"1\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.python.org/cs01/48/612_2.png\" class=\"avatar\"\u003e cs01:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eFalling back to \u003ccode\u003esite-packages\u003c/code\u003e reduces usefulness of \u003ccode\u003e__pypackages__\u003c/code\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eWhen the idea of this PEP was being discussed at the 2018 dev sprints this was a contentious topic (this is more of an FYI as I fell on the \"ignore \u003ccode\u003esite-packages\u003c/code\u003e side \u003cimg src=\"https://emoji.discourse-cdn.com/apple/slight_smile.png?v=12\" title=\":slight_smile:\" class=\"emoji\" alt=\":slight_smile:\" loading=\"lazy\" width=\"20\" height=\"20\"\u003e).\u003c/p\u003e\n\u003caside class=\"quote no-group\" data-username=\"cs01\" data-post=\"1\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.python.org/cs01/48/612_2.png\" class=\"avatar\"\u003e cs01:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eOne of the really nice things about this is that the directory structure can be copied directly and run on different machines. However, if code gets copied from a windows machine to linux server and attempted to run, it may fail (with cryptic error messages) due to OS differences. I suggest namespacing on Python version as well as os, such as \u003ccode\u003e__pypackages__/windows/3.6/...\u003c/code\u003e .\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eBut how far do you take this? For instance, that doesn’t cover OS version like wheels do, so do you actually namespace it by the platform tag of the most strict package that you installed? And if you do that then you have now made wheel tags part of the Python’s stdlib which they currently are not so they can evolve independent of CPython’s release cycle.\u003c/p\u003e\n\u003cp\u003eSo I personally disagree with making this a deployment solution.\u003c/p\u003e","post_number":3,"post_type":1,"posts_count":445,"updated_at":"2019-03-01T19:56:06.508Z","reply_count":1,"reply_to_post_number":null,"quote_count":1,"incoming_link_count":14,"reads":287,"readers_count":286,"score":132.4,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Brett Cannon","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"link_counts":[{"url":"https://www.python.org/dev/peps/pep-0582/","internal":false,"reflection":false,"title":"PEP 582 -- Python local packages directory | Python.org","clicks":98}],"read":true,"user_title":"CPython core developer","title_is_group":true,"bookmarked":false,"actions_summary":[],"moderator":true,"admin":true,"staff":true,"user_id":36,"hidden":false,"trust_level":4,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/3","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4917,"name":"Steve Dower","username":"steve.dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png","created_at":"2019-03-01T20:22:12.633Z","cooked":"\u003cp\u003eUnsurprisingly, I have a lot to say, more than I’m going to type on my phone \u003cimg src=\"https://emoji.discourse-cdn.com/apple/slight_smile.png?v=6\" title=\":slight_smile:\" class=\"emoji\" alt=\":slight_smile:\"\u003e\u003c/p\u003e\n\u003cp\u003eThe idea with site-packages was that pip would ignore it for the purposes of dependency resolution, but Python would allow importing from it even when local packages are found (in large part to avoid having to install pip yet again).\u003c/p\u003e\n\u003cp\u003eI don’t like characterising this as “node_modules for Python” as people immediately assume heavily nested dependencies. This is far more like venv without activate scripts.\u003c/p\u003e\n\u003cp\u003eDonald specifically requested we not specify pip changes in the PEP, so we will need him to chime in with his thoughts. But there is as assumption that other tools will need changes for this to all work properly - ecosystem-wide problems can’t be solved unilaterally (except by inventing a new ecosystem).\u003c/p\u003e","post_number":4,"post_type":1,"posts_count":445,"updated_at":"2019-03-01T20:22:12.633Z","reply_count":2,"reply_to_post_number":null,"quote_count":0,"incoming_link_count":17,"reads":251,"readers_count":250,"score":175.2,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Steve Dower","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"CPython core developer","title_is_group":true,"bookmarked":false,"actions_summary":[{"id":2,"count":2}],"moderator":false,"admin":false,"staff":false,"user_id":54,"hidden":false,"trust_level":3,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/4","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4934,"name":"Bernát Gábor","username":"bernatgabor","avatar_template":"/user_avatar/discuss.python.org/bernatgabor/{size}/3003_2.png","created_at":"2019-03-02T17:58:20.360Z","cooked":"\u003cp\u003eI’m not sure I love the whole concept of this PEP. My main concern it would help in a very-very small subset of problems, and once one tries to generalize and gets to something like:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"lang-auto\"\u003eproject\n├─ __pypackages__\n├─ a\n│   └─ __pypackages__\n└─ b\n    └── __pypackages__\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eIt will be really hard to manage. Why do we need to activate envs? One can always just to\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"lang-auto\"\u003epython -m venv env\nenv/bin/pip install whatever\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eThe only benefit is saving up on the \u003ccode\u003eenv/bin/pip\u003c/code\u003e part that can be easily hidden/automated behind countless shell aliases.\u003c/p\u003e","post_number":5,"post_type":1,"posts_count":445,"updated_at":"2019-03-02T17:58:57.478Z","reply_count":1,"reply_to_post_number":4,"quote_count":0,"incoming_link_count":12,"reads":236,"readers_count":235,"score":157.2,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Bernát Gábor","primary_group_name":null,"flair_name":null,"flair_url":null,"flair_bg_color":null,"flair_color":null,"flair_group_id":null,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"","reply_to_user":{"id":54,"username":"steve.dower","name":"Steve Dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png"},"bookmarked":false,"actions_summary":[{"id":2,"count":3}],"moderator":false,"admin":false,"staff":false,"user_id":71,"hidden":false,"trust_level":2,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/5","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4935,"name":"Steve Dower","username":"steve.dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png","created_at":"2019-03-02T18:37:59.712Z","cooked":"\u003cp\u003eOne of those very very small subsets is teaching first-time programmers how to use libraries, or providing them with helper modules that they can use without having to see. If you also want to teach them “countless shell aliases” as a prerequisite, be my guest.\u003c/p\u003e\n\u003cp\u003eI don’t think it’s a coincidence that every single teacher who has seen this idea absolutely loves it.\u003c/p\u003e","post_number":6,"post_type":1,"posts_count":445,"updated_at":"2019-03-02T18:37:59.712Z","reply_count":3,"reply_to_post_number":5,"quote_count":0,"incoming_link_count":8,"reads":221,"readers_count":220,"score":159.2,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Steve Dower","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"CPython core developer","title_is_group":true,"reply_to_user":{"id":71,"username":"bernatgabor","name":"Bernát Gábor","avatar_template":"/user_avatar/discuss.python.org/bernatgabor/{size}/3003_2.png"},"bookmarked":false,"actions_summary":[{"id":2,"count":4}],"moderator":false,"admin":false,"staff":false,"user_id":54,"hidden":false,"trust_level":3,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/6","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4936,"name":"Bernát Gábor","username":"bernatgabor","avatar_template":"/user_avatar/discuss.python.org/bernatgabor/{size}/3003_2.png","created_at":"2019-03-02T18:53:36.267Z","cooked":"\u003cp\u003eI’m not debating that this is great for newcomers. However, feels yet another way of doing things for sake of newcomers only. My doubt is more along the lines of do we need first class support for the interpreter to achieve this? Or is something we can do with a tool that reuses existing mechanism inside the interpreter (aka set pythonpath, shim commands to the pypackages folder if exists).\u003c/p\u003e","post_number":7,"post_type":1,"posts_count":445,"updated_at":"2019-03-02T18:53:36.267Z","reply_count":1,"reply_to_post_number":6,"quote_count":0,"incoming_link_count":1,"reads":211,"readers_count":210,"score":67.2,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Bernát Gábor","primary_group_name":null,"flair_name":null,"flair_url":null,"flair_bg_color":null,"flair_color":null,"flair_group_id":null,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"","reply_to_user":{"id":54,"username":"steve.dower","name":"Steve Dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png"},"bookmarked":false,"actions_summary":[{"id":2,"count":1}],"moderator":false,"admin":false,"staff":false,"user_id":71,"hidden":false,"trust_level":2,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/7","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4938,"name":"Steve Dower","username":"steve.dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png","created_at":"2019-03-02T19:00:40.382Z","cooked":"\u003cp\u003eFor the most part, it can be done by telling students “python” is spelled “pythonloc” sometimes. Though making that available on arbitrary machines is its own challenge.\u003c/p\u003e\n\u003cp\u003eAnd for something so simple, why not put it in the core runtime? If there is no pypackages folder in the directory of the file you’re launching, it’s as if it just isn’t supported and you’re on your own, just like today. This doesn’t make venv redundant, it just raises the bar before you need it.\u003c/p\u003e\n\u003cp\u003eYou may not have heard, but there are going to be literally millions of students starting with Python over the next year or two as China, France and other countries start mandating it in schools. Every point of friction for both teachers and students will make them regret that choice, so I would love to get ahead of the problems we already know about.\u003c/p\u003e","post_number":8,"post_type":1,"posts_count":445,"updated_at":"2019-03-02T19:00:40.382Z","reply_count":3,"reply_to_post_number":7,"quote_count":0,"incoming_link_count":9,"reads":212,"readers_count":211,"score":147.4,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Steve Dower","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"CPython core developer","title_is_group":true,"reply_to_user":{"id":71,"username":"bernatgabor","name":"Bernát Gábor","avatar_template":"/user_avatar/discuss.python.org/bernatgabor/{size}/3003_2.png"},"bookmarked":false,"actions_summary":[{"id":2,"count":3}],"moderator":false,"admin":false,"staff":false,"user_id":54,"hidden":false,"trust_level":3,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/8","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4939,"name":"Steve Dower","username":"steve.dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png","created_at":"2019-03-02T19:04:52.242Z","cooked":"\u003cp\u003eAlso, the schools aren’t going to get Python from the core team - they’ll get it from companies willing to support them. So we’ll see more hybrid not-quite-Python versions being used in order to fix or workaround things that are too complex. None of the feedback will make it to the core team - we’re seen as too hostile toward companies for them to ever consider that we might appreciate their feedback (or, gasp, contributions).\u003c/p\u003e\n\u003cp\u003eSo Python becomes known to students by another name with another interface and they wonder why “real Python developers” have such complicated tools.\u003c/p\u003e","post_number":9,"post_type":1,"posts_count":445,"updated_at":"2019-03-02T19:04:52.242Z","reply_count":1,"reply_to_post_number":8,"quote_count":0,"incoming_link_count":4,"reads":204,"readers_count":203,"score":95.8,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Steve Dower","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"CPython core developer","title_is_group":true,"reply_to_user":{"id":54,"username":"steve.dower","name":"Steve Dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png"},"bookmarked":false,"actions_summary":[{"id":2,"count":2}],"moderator":false,"admin":false,"staff":false,"user_id":54,"hidden":false,"trust_level":3,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/9","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4940,"name":"Bernát Gábor","username":"bernatgabor","avatar_template":"/user_avatar/discuss.python.org/bernatgabor/{size}/3003_2.png","created_at":"2019-03-02T19:15:56.265Z","cooked":"\u003cp\u003eI suppose then it’s alright as long as we advertise it as something for beginners/one venv driven use cases.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eFalling back to  \u003ccode\u003esite-packages\u003c/code\u003e  reduces usefulness of  \u003ccode\u003e__pypackages__\u003c/code\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eGranted if we do not fallback we MUST install pip again. However, who creates this pypackages, not pip? If so shouldn’t be that hard to install pip on first use by matching the host version. I assume pip will have some \u003ccode\u003e--here\u003c/code\u003e flag that creates the folder, not? Then again if we must let’s include global site package, but do remove local site package. We aim it at students as I understand. In universities, users mostly can’t change global site-packages, but easily can install local packages. I would try to minimize the issues with having something installed in user site package causing issues.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eNamespacing of packages in  \u003ccode\u003e__pypackages__\u003c/code\u003e  does not include OS\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eAgreed the scope is not to create deploy-able packages. Furthermore many packages are platform only working (numpy e.g.) this dependency should be very much present in the folder structure.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eRunning binaries or “scripts”\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eBut python already has \u003ccode\u003e-m\u003c/code\u003e, we should push using \u003ccode\u003epython -m flake8\u003c/code\u003e, not (instead of pipx or something similar)?\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eInstalling/Uninstalling from  \u003ccode\u003e__pypackages__\u003c/code\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eBy default? I would say that’s out of out of question for pip. More likely a flag would be needed to turn on the pypackages thing, for backwards compatibility.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eFreezability\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eI think what you’re describing is possible with current tooling. If we fallback through reproducibility is in question. Would be hard for tool to check if some stuff gets satisfied from global or local, especially stuff that’s runtime only required.\u003c/p\u003e","post_number":10,"post_type":1,"posts_count":445,"updated_at":"2019-03-02T19:15:56.265Z","reply_count":2,"reply_to_post_number":8,"quote_count":0,"incoming_link_count":13,"reads":207,"readers_count":206,"score":116.4,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Bernát Gábor","primary_group_name":null,"flair_name":null,"flair_url":null,"flair_bg_color":null,"flair_color":null,"flair_group_id":null,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"","reply_to_user":{"id":54,"username":"steve.dower","name":"Steve Dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png"},"bookmarked":false,"actions_summary":[],"moderator":false,"admin":false,"staff":false,"user_id":71,"hidden":false,"trust_level":2,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/10","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4996,"name":"Chad Smith","username":"cs01","avatar_template":"/user_avatar/discuss.python.org/cs01/{size}/612_2.png","created_at":"2019-03-05T12:21:47.435Z","cooked":"\u003caside class=\"quote group-committers\" data-username=\"brettcannon\" data-post=\"3\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/brettcannon/48/34895_2.png\" class=\"avatar\"\u003e brettcannon:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eSo I personally disagree with making this a deployment solution.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eAgreed that only the most strict version makes sense to use, and that doing that isn’t a practical solution. So I revoke my suggestion \u003cimg src=\"https://emoji.discourse-cdn.com/apple/slight_smile.png?v=15\" title=\":slight_smile:\" class=\"emoji\" alt=\":slight_smile:\" loading=\"lazy\" width=\"20\" height=\"20\"\u003e\u003c/p\u003e\n\u003caside class=\"quote group-committers\" data-username=\"steve.dower\" data-post=\"4\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/steve.dower/48/56_2.png\" class=\"avatar\"\u003e steve.dower:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eThe idea with site-packages was that pip would ignore it for the purposes of dependency resolution, but Python would allow importing from it even when local packages are found (in large part to avoid having to install pip yet again).\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eI understand, and I see your point about not having to re-install. But there are cases where it’s preferable to raise an error if a package isn’t found locally (and is installed in site-packages).\u003c/p\u003e\n\u003cp\u003eFor example, I think a really desirable workflow is to run something like \u003ccode\u003epip install pip.lock --here\u003c/code\u003e then run \u003ccode\u003epython app.py\u003c/code\u003e and be certain that it’s only looking in \u003ccode\u003e__pypackages__\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThis would result in hermetic, repeatable package resolution and eliminate “runs on my machine” type of issues, which is currently a large use-case for Virtual Environments (and Pipenv/poetry).\u003c/p\u003e\n\u003cp\u003eSince not searching site-packages would be a (surprising) change from current behavior, maybe a flag could be added to python such as \u003ccode\u003e--pypackages\u003c/code\u003e, \u003ccode\u003e--here-only\u003c/code\u003e, etc. where Python only searches the current working dir and the appropriate \u003ccode\u003e__pypackages__\u003c/code\u003e directory.\u003c/p\u003e\n\u003caside class=\"quote group-committers\" data-username=\"steve.dower\" data-post=\"4\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/steve.dower/48/56_2.png\" class=\"avatar\"\u003e steve.dower:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eI don’t like characterising this as “node_modules for Python” as people immediately assume heavily nested dependencies. This is far more like venv without activate scripts.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eOn that note, \u003ca class=\"mention\" href=\"/u/bernatgabor\"\u003e@bernatgabor\u003c/a\u003e listed out a sample directory tree with nested \u003ccode\u003e__pypackages__\u003c/code\u003e folders. My understanding is that would not be the case, is that correct? Also, venv has the \u003ccode\u003e--system-site-packages\u003c/code\u003e option. Hopefully this PEP can have similar flexibility.\u003c/p\u003e\n\u003caside class=\"quote no-group\" data-username=\"bernatgabor\" data-post=\"10\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/bernatgabor/48/3003_2.png\" class=\"avatar\"\u003e bernatgabor:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eBut python already has \u003ccode\u003e-m\u003c/code\u003e , we should push using \u003ccode\u003epython -m flake8\u003c/code\u003e , not (instead of pipx or something similar)?\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eThe \u003ccode\u003e-m\u003c/code\u003e only works for a single entry point, and that’s only if the developer included a \u003ccode\u003e__main__.py\u003c/code\u003e file. But there could be many, and there could be scripts installed by dependent packages. For example, \u003ccode\u003ejupyter\u003c/code\u003e installs no scripts of its own, but has many dependencies which install executable files to \u003ccode\u003e__pypackages__/3.6/lib/bin\u003c/code\u003e, for example:\u003c/p\u003e\n\u003cpre data-code-wrap=\"python\"\u003e\u003ccode class=\"lang-python\"\u003eeasy_install             jsonschema               jupyter-migrate          jupyter-serverextension\neasy_install-3.6         jupyter                  jupyter-nbconvert        jupyter-troubleshoot\niptest                   jupyter-bundlerextension jupyter-nbextension      jupyter-trust\niptest3                  jupyter-console          jupyter-notebook         pygmentize\nipython                  jupyter-kernel           jupyter-qtconsole\nipython3                 jupyter-kernelspec       jupyter-run\n\u003c/code\u003e\u003c/pre\u003e","post_number":11,"post_type":1,"posts_count":445,"updated_at":"2019-03-05T12:21:47.435Z","reply_count":2,"reply_to_post_number":3,"quote_count":3,"incoming_link_count":27,"reads":194,"readers_count":193,"score":198.8,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Chad Smith","primary_group_name":null,"flair_name":null,"flair_url":null,"flair_bg_color":null,"flair_color":null,"flair_group_id":null,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":null,"bookmarked":false,"actions_summary":[{"id":2,"count":1}],"moderator":false,"admin":false,"staff":false,"user_id":444,"hidden":false,"trust_level":1,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/11","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4997,"name":"Tzu-ping Chung","username":"uranusjr","avatar_template":"/user_avatar/discuss.python.org/uranusjr/{size}/103_2.png","created_at":"2019-03-05T12:55:44.215Z","cooked":"\u003caside class=\"quote no-group quote-modified\" data-username=\"cs01\" data-post=\"11\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.python.org/cs01/48/612_2.png\" class=\"avatar\"\u003e cs01:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eThe \u003ccode\u003e-m\u003c/code\u003e only works for a single entry point, and that’s only if the developer included a \u003ccode\u003e__main__.py\u003c/code\u003e file. But there could be many, and there could be scripts installed by dependent packages. For example, \u003ccode\u003ejupyter\u003c/code\u003e installs no scripts of its own, but has many dependencies which install executable files to \u003ccode\u003e__pypackages__/3.6/lib/bin\u003c/code\u003e.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eThis can be easily (IMHO) solved by sub modules, e.g. \u003ccode\u003epython -m jupyter.console\u003c/code\u003e. For Jupyter specifically, however, the real issue is (again, IMHO) neither site-packages nor \u003ccode\u003e__pypackages__\u003c/code\u003e is a good way to deploy it (tieing back to the app deployment story topic).\u003c/p\u003e","post_number":12,"post_type":1,"posts_count":445,"updated_at":"2019-03-05T12:56:06.777Z","reply_count":1,"reply_to_post_number":11,"quote_count":1,"incoming_link_count":3,"reads":158,"readers_count":157,"score":96.6,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Tzu-ping Chung","primary_group_name":null,"flair_name":null,"flair_url":null,"flair_bg_color":null,"flair_color":null,"flair_group_id":null,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":null,"bookmarked":false,"actions_summary":[{"id":2,"count":3}],"moderator":false,"admin":false,"staff":false,"user_id":89,"hidden":false,"trust_level":2,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/12","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4998,"name":"Paul Moore","username":"pf_moore","avatar_template":"/user_avatar/discuss.python.org/pf_moore/{size}/35_2.png","created_at":"2019-03-05T13:38:36.590Z","cooked":"\u003caside class=\"quote no-group quote-modified\" data-username=\"bernatgabor\" data-post=\"10\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.python.org/bernatgabor/48/3003_2.png\" class=\"avatar\"\u003e bernatgabor:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cblockquote\u003e\n\u003cp\u003eRunning binaries or “scripts”\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eBut python already has \u003ccode\u003e-m\u003c/code\u003e , we should push using \u003ccode\u003epython -m flake8\u003c/code\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eAgreed. Or using console scripts installed in a “proper” packages directory. Or using some other existing application deployment method.\u003c/p\u003e\n\u003cp\u003eIf you’re installing something in \u003ccode\u003e__pypackages__\u003c/code\u003e, then I’d assume it’s in support of the Python script(s) in the directory that contains \u003ccode\u003e__pypackages__\u003c/code\u003e, and so you would not be interested in any executables that may be installed - your interface to the installed packages will be from your Python script using the package’s python API.\u003c/p\u003e\n\u003cp\u003eI don’t think it’s a big enough deal to want to explicitly \u003cem\u003eremove\u003c/em\u003e the console scripts from the installation, but equally I think that anyone running a console script from \u003ccode\u003e__pypackages__\u003c/code\u003e is doing something wrong…\u003c/p\u003e","post_number":13,"post_type":1,"posts_count":445,"updated_at":"2019-03-05T13:38:36.590Z","reply_count":1,"reply_to_post_number":10,"quote_count":1,"incoming_link_count":4,"reads":160,"readers_count":159,"score":87.0,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Paul Moore","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"CPython core developer","title_is_group":true,"bookmarked":false,"actions_summary":[{"id":2,"count":2}],"moderator":false,"admin":false,"staff":false,"user_id":35,"hidden":false,"trust_level":3,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/13","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":4999,"name":"Steve Dower","username":"steve.dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png","created_at":"2019-03-05T16:03:11.625Z","cooked":"\u003cp\u003eYeah, the console scripts issue is probably the thorniest part, but simultaneously I’m becoming more convinced that the majority of incoming Python users do not want to be tied to the console and are only doing it because we force them into it. So as tools learn about -m, and packages learn to support it, it will become less of an issue.\u003c/p\u003e\n\u003cp\u003eAnd if console users have to run some special command to update their PATH to avoid typing “python -m” before their commands (maybe we can call it… \u003ccode\u003eactivate\u003c/code\u003e \u003cimg src=\"https://emoji.discourse-cdn.com/apple/slight_smile.png?v=6\" title=\":slight_smile:\" class=\"emoji\" alt=\":slight_smile:\"\u003e ) but every other use case works without relying on environment variables, I think that’s a great place to end up.\u003c/p\u003e","post_number":14,"post_type":1,"posts_count":445,"updated_at":"2019-03-05T16:03:11.625Z","reply_count":1,"reply_to_post_number":null,"quote_count":0,"incoming_link_count":5,"reads":149,"readers_count":148,"score":59.8,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Steve Dower","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"CPython core developer","title_is_group":true,"bookmarked":false,"actions_summary":[],"moderator":false,"admin":false,"staff":false,"user_id":54,"hidden":false,"trust_level":3,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/14","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":5000,"name":"Steve Dower","username":"steve.dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png","created_at":"2019-03-05T16:05:36.955Z","cooked":"\u003caside class=\"quote no-group\" data-username=\"uranusjr\" data-post=\"12\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.python.org/uranusjr/48/103_2.png\" class=\"avatar\"\u003e uranusjr:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eThis can be easily (IMHO) solved by sub modules, e.g. \u003ccode\u003epython -m jupyter.console\u003c/code\u003e .\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eI thought Jupyter already had subcommands for these, and the long names were legacy? So it’s \u003ccode\u003epython -m jupyter console\u003c/code\u003e or \u003ccode\u003epython -m jupyter notebook\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eAgreed that the real problem is that Jupyter is more of a self-contained app than a library though. Just pointing out a valid and generally well understood pattern that already exists for multiple entry points\u003c/p\u003e","post_number":15,"post_type":1,"posts_count":445,"updated_at":"2019-03-05T16:05:36.955Z","reply_count":0,"reply_to_post_number":12,"quote_count":1,"incoming_link_count":5,"reads":147,"readers_count":146,"score":99.4,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Steve Dower","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"CPython core developer","title_is_group":true,"bookmarked":false,"actions_summary":[{"id":2,"count":3}],"moderator":false,"admin":false,"staff":false,"user_id":54,"hidden":false,"trust_level":3,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/15","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":5003,"name":"Brett Cannon","username":"brettcannon","avatar_template":"/user_avatar/discuss.python.org/brettcannon/{size}/34895_2.png","created_at":"2019-03-05T21:28:10.995Z","cooked":"\u003caside class=\"quote no-group\" data-username=\"cs01\" data-post=\"11\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.python.org/cs01/48/612_2.png\" class=\"avatar\"\u003e cs01:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eOn that note, \u003ca class=\"mention\" href=\"/u/bernatgabor\"\u003e@bernatgabor\u003c/a\u003e listed out a sample directory tree with nested \u003ccode\u003e__pypackages__\u003c/code\u003e folders. My understanding is that would not be the case, is that correct?\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eCorrect.\u003c/p\u003e\n\u003caside class=\"quote no-group\" data-username=\"cs01\" data-post=\"11\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.python.org/cs01/48/612_2.png\" class=\"avatar\"\u003e cs01:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eAlso, venv has the \u003ccode\u003e--system-site-packages\u003c/code\u003e option. Hopefully this PEP can have similar flexibility.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003ePossibly not because the current solution is literally just a default \u003ccode\u003esys.path\u003c/code\u003e entry when the interpreter runs while the latter adds more complication as it now becomes a configuration option somehow.\u003c/p\u003e","post_number":16,"post_type":1,"posts_count":445,"updated_at":"2019-03-05T21:28:10.995Z","reply_count":1,"reply_to_post_number":11,"quote_count":1,"incoming_link_count":4,"reads":145,"readers_count":144,"score":54.0,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Brett Cannon","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"CPython core developer","title_is_group":true,"bookmarked":false,"actions_summary":[],"moderator":true,"admin":true,"staff":true,"user_id":36,"hidden":false,"trust_level":4,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/16","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":5007,"name":"Bernát Gábor","username":"bernatgabor","avatar_template":"/user_avatar/discuss.python.org/bernatgabor/{size}/3003_2.png","created_at":"2019-03-05T22:15:32.872Z","cooked":"\u003cp\u003eWhy would that not be the case, what would stop users doing it?\u003c/p\u003e","post_number":17,"post_type":1,"posts_count":445,"updated_at":"2019-03-05T22:15:32.872Z","reply_count":1,"reply_to_post_number":16,"quote_count":0,"incoming_link_count":1,"reads":144,"readers_count":143,"score":38.8,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Bernát Gábor","primary_group_name":null,"flair_name":null,"flair_url":null,"flair_bg_color":null,"flair_color":null,"flair_group_id":null,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"","reply_to_user":{"id":36,"username":"brettcannon","name":"Brett Cannon","avatar_template":"/user_avatar/discuss.python.org/brettcannon/{size}/34895_2.png"},"bookmarked":false,"actions_summary":[],"moderator":false,"admin":false,"staff":false,"user_id":71,"hidden":false,"trust_level":2,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/17","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":5012,"name":"Steve Dower","username":"steve.dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png","created_at":"2019-03-05T22:43:24.406Z","cooked":"\u003cp\u003e(I assume you mean what’s to stop people nesting \u003ccode\u003e__pypackages__\u003c/code\u003e folders down the hierarchy?)\u003c/p\u003e\n\u003cp\u003eWhat stops them is the logic of how they work:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"lang-auto\"\u003epython /path/to/my/script.py\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eThis adds \u003ccode\u003e/path/to/my/__pypackages__/\u0026lt;version\u0026gt;\u003c/code\u003e to \u003ccode\u003esys.path\u003c/code\u003e if it exists, and then runs as normal. That’s it. There’s no logic anywhere to recursively search for them or to add it to any subpackages.\u003c/p\u003e\n\u003cp\u003e(\u003cstrong\u003eEdit\u003c/strong\u003e: Add the \u003ccode\u003e\u0026lt;version\u0026gt;\u003c/code\u003e part of the path, which I personally still don’t really care for, but since it seems more likely to prevent issues than to cause new ones I’ll concede the point.)\u003c/p\u003e","post_number":18,"post_type":1,"posts_count":445,"updated_at":"2019-03-05T22:44:18.296Z","reply_count":1,"reply_to_post_number":17,"quote_count":0,"incoming_link_count":11,"reads":160,"readers_count":159,"score":92.0,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Steve Dower","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"CPython core developer","title_is_group":true,"reply_to_user":{"id":71,"username":"bernatgabor","name":"Bernát Gábor","avatar_template":"/user_avatar/discuss.python.org/bernatgabor/{size}/3003_2.png"},"bookmarked":false,"actions_summary":[],"moderator":false,"admin":false,"staff":false,"user_id":54,"hidden":false,"trust_level":3,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/18","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":5150,"name":"Pradyun Gedam","username":"pradyunsg","avatar_template":"/user_avatar/discuss.python.org/pradyunsg/{size}/206_2.png","created_at":"2019-03-09T20:39:02.796Z","cooked":"\u003cp\u003eI’m on board for this idea. I’ve been on both sides of the classroom – learning and teaching – and this would be great.\u003c/p\u003e\n\u003cp\u003eMy main concern currently is fleshing this out and how this would look on pip’s side of things. I think \u003ca class=\"mention\" href=\"/u/dstufft\"\u003e@dstufft\u003c/a\u003e has likely spent time thinking about (at least) the latter, so I look forward to hearing from him on this front.\u003c/p\u003e","post_number":19,"post_type":1,"posts_count":445,"updated_at":"2019-03-09T20:39:02.796Z","reply_count":0,"reply_to_post_number":18,"quote_count":0,"incoming_link_count":3,"reads":156,"readers_count":155,"score":61.2,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Pradyun Gedam","primary_group_name":"committers","flair_name":"committers","flair_url":"https://us1.discourse-cdn.com/flex002/uploads/python1/original/1X/ca0883b21b8210c5a62c9ac02353de5f24a4d6fc.png","flair_bg_color":"006b94","flair_color":"fac731","flair_group_id":41,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":"CPython core developer","title_is_group":true,"reply_to_user":{"id":54,"username":"steve.dower","name":"Steve Dower","avatar_template":"/user_avatar/discuss.python.org/steve.dower/{size}/56_2.png"},"bookmarked":false,"actions_summary":[{"id":2,"count":1}],"moderator":false,"admin":false,"staff":false,"user_id":164,"hidden":false,"trust_level":3,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/19","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null},{"id":5171,"name":"Chad Smith","username":"cs01","avatar_template":"/user_avatar/discuss.python.org/cs01/{size}/612_2.png","created_at":"2019-03-11T16:19:15.790Z","cooked":"\u003caside class=\"quote group-committers\" data-username=\"pf_moore\" data-post=\"13\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.python.org/pf_moore/48/35_2.png\" class=\"avatar\"\u003e pf_moore:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003ebut equally I think that anyone running a console script from \u003ccode\u003e__pypackages__\u003c/code\u003e is doing something wrong…\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eWhat if one wants to run a specific version of pyptest/tox/black/flake8/mypy, etc on the code? You’d need to use a virtual environment. Is it wrong to not want to create one?\u003c/p\u003e\n\u003cp\u003eRunning these entry points a desirable feature in a similar community; JavaScript/node has npx which they/I really love. The massively popular \u003ca href=\"https://babeljs.io/docs/en/babel-cli#usage\" rel=\"noopener nofollow ugc\"\u003ebabel\u003c/a\u003e, among others, recommends its use in their docs. Whether you think it is a good idea or not for Python, it’s likely going to be one of the most brought up questions if PEP 582 is accepted.\u003c/p\u003e\n\u003cp\u003ePEP 582 was discussed on \u003ca href=\"https://pythonbytes.fm/episodes/show/117/is-this-the-end-of-python-virtual-environments\" rel=\"noopener nofollow ugc\"\u003ePython Bytes #117\u003c/a\u003e. They were really receptive to the idea, but first thing they mentioned as “missing” was the entry points. Another interesting thought they brought up was along the lines of “what if the content of \u003ccode\u003e__pypackages__\u003c/code\u003e was the same as a virtual environment, and if you wanted, you could activate/deactivate it?”\u003c/p\u003e\n\u003caside class=\"quote group-committers\" data-username=\"steve.dower\" data-post=\"14\" data-topic=\"963\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.python.org/steve.dower/48/56_2.png\" class=\"avatar\"\u003e steve.dower:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003esimultaneously I’m becoming more convinced that the majority of incoming Python users do not want to be tied to the console and are only doing it because we force them into it.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eWhat would they use instead?\u003c/p\u003e\n\u003cp\u003eI love console entry points (probably no surprise since I authored pipx). But they really do fill a need for many. In many ways, it’s the closest thing Python has to distributing an executable binary. I made pipx because I was trying to distribute a standalone application, and all my README instructions ended up being so cumbersome to non-python people: create a virtual environment, pip install, okay NOW you can run a simple command from the terminal.\u003c/p\u003e\n\u003chr\u003e\n\u003cp\u003eSort of a meta point that has been on my mind is the approach for making these changes. The packaging space is big and complex, with numerous use-cases. It seems like this discussion is revolving around personal preferences and intuition about user behavior. Seems like a (semi-)exhaustive list of workflows people need, from user to expert, laid out somewhere would be helpful (to me at least). We could then discuss which of those workflows and demographics should be addressed by this PEP. Right now I can’t really tell who we’re targeting or which workflows we’re targeting.\u003c/p\u003e","post_number":20,"post_type":1,"posts_count":445,"updated_at":"2019-03-11T17:05:35.254Z","reply_count":1,"reply_to_post_number":13,"quote_count":2,"incoming_link_count":27,"reads":193,"readers_count":192,"score":193.6,"yours":false,"topic_id":963,"topic_slug":"pep-582-python-local-packages-directory","display_username":"Chad Smith","primary_group_name":null,"flair_name":null,"flair_url":null,"flair_bg_color":null,"flair_color":null,"flair_group_id":null,"badges_granted":[],"version":2,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"link_counts":[{"url":"https://pythonbytes.fm/episodes/show/117/is-this-the-end-of-python-virtual-environments","internal":false,"reflection":false,"title":"Episode #117 Is this the end of Python virtual environments? - [Python Bytes Podcast]","clicks":2},{"url":"https://babeljs.io/docs/en/babel-cli#usage","internal":false,"reflection":false,"title":"@babel/cli · Babel","clicks":1}],"read":true,"user_title":null,"bookmarked":false,"actions_summary":[{"id":2,"count":1}],"moderator":false,"admin":false,"staff":false,"user_id":444,"hidden":false,"trust_level":1,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/pep-582-python-local-packages-directory/963/20","can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":null}]},"id":963}