{"action":"created","issue":{"url":"https://api.github.com/repos/ipython/ipython/issues/9517","repository_url":"https://api.github.com/repos/ipython/ipython","labels_url":"https://api.github.com/repos/ipython/ipython/issues/9517/labels{/name}","comments_url":"https://api.github.com/repos/ipython/ipython/issues/9517/comments","events_url":"https://api.github.com/repos/ipython/ipython/issues/9517/events","html_url":"https://github.com/ipython/ipython/issues/9517","id":157905098,"number":9517,"title":"Install packages into the right environment","user":{"login":"takluyver","id":327925,"avatar_url":"https://avatars.githubusercontent.com/u/327925?v=3","gravatar_id":"","url":"https://api.github.com/users/takluyver","html_url":"https://github.com/takluyver","followers_url":"https://api.github.com/users/takluyver/followers","following_url":"https://api.github.com/users/takluyver/following{/other_user}","gists_url":"https://api.github.com/users/takluyver/gists{/gist_id}","starred_url":"https://api.github.com/users/takluyver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takluyver/subscriptions","organizations_url":"https://api.github.com/users/takluyver/orgs","repos_url":"https://api.github.com/users/takluyver/repos","events_url":"https://api.github.com/users/takluyver/events{/privacy}","received_events_url":"https://api.github.com/users/takluyver/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ipython/ipython/milestones/25","html_url":"https://github.com/ipython/ipython/milestones/5.0","labels_url":"https://api.github.com/repos/ipython/ipython/milestones/25/labels","id":1020999,"number":25,"title":"5.0","description":"","creator":{"login":"Carreau","id":335567,"avatar_url":"https://avatars.githubusercontent.com/u/335567?v=3","gravatar_id":"","url":"https://api.github.com/users/Carreau","html_url":"https://github.com/Carreau","followers_url":"https://api.github.com/users/Carreau/followers","following_url":"https://api.github.com/users/Carreau/following{/other_user}","gists_url":"https://api.github.com/users/Carreau/gists{/gist_id}","starred_url":"https://api.github.com/users/Carreau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carreau/subscriptions","organizations_url":"https://api.github.com/users/Carreau/orgs","repos_url":"https://api.github.com/users/Carreau/repos","events_url":"https://api.github.com/users/Carreau/events{/privacy}","received_events_url":"https://api.github.com/users/Carreau/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":151,"state":"open","created_at":"2015-03-13T21:27:20Z","updated_at":"2016-06-03T11:48:12Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-06-01T13:22:07Z","updated_at":"2016-06-03T15:58:15Z","closed_at":null,"body":"The biggest cause of issues I see when helping people with Python is confusion over installing packages in different environments and different Python installations. This typically takes the form of:\r\n\r\n> I can do foo when running X but not when running Y (e.g. the notebook). Help!\r\n\r\nWhere the issue is that Y is running their code in a different environment or with a different Python, and that either doesn't have a module, or has a different version. This is only getting worse as using environments and multiple Python versions becomes more common.\r\n\r\nI know we don't want to wade into package management, but I think IPython is quite well placed to provide a simple but useful interface. Something along the lines of @Carreau's [pip_magic](https://github.com/Carreau/pip_magic), but I think there are a couple of major issues with that:\r\n\r\n1. I think it's pedagogically bad to use exactly the same interface as the `pip` command line, because we already see enough people confused about the distinction between command line and Python commands.\r\n2. It's unaware of conda, and e.g. updating a package with pip when it's been conda installed can lead to problems.\r\n3. You have to install it in each environment before using it, which brings you back to the original issue! This would be reduced if such a function were included in IPython.\r\n\r\nI'd like to have something akin to R's [install.packages](http://stat.ethz.ch/R-manual/R-devel/library/utils/html/install.packages.html) function, which is the primary way to install packages inside R. Can we design something that has sufficient awareness of pip and conda packages, and virtualenvs and conda envs, that we can tell users to e.g. `install('matplotlib')`, and it will work out the best way to do that in the current environment."},"comment":{"url":"https://api.github.com/repos/ipython/ipython/issues/comments/223618939","html_url":"https://github.com/ipython/ipython/issues/9517#issuecomment-223618939","issue_url":"https://api.github.com/repos/ipython/ipython/issues/9517","id":223618939,"user":{"login":"takluyver","id":327925,"avatar_url":"https://avatars.githubusercontent.com/u/327925?v=3","gravatar_id":"","url":"https://api.github.com/users/takluyver","html_url":"https://github.com/takluyver","followers_url":"https://api.github.com/users/takluyver/followers","following_url":"https://api.github.com/users/takluyver/following{/other_user}","gists_url":"https://api.github.com/users/takluyver/gists{/gist_id}","starred_url":"https://api.github.com/users/takluyver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takluyver/subscriptions","organizations_url":"https://api.github.com/users/takluyver/orgs","repos_url":"https://api.github.com/users/takluyver/repos","events_url":"https://api.github.com/users/takluyver/events{/privacy}","received_events_url":"https://api.github.com/users/takluyver/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T15:58:15Z","updated_at":"2016-06-03T15:58:15Z","body":"> I think the only practical way to deal with this would be brute force: spider the available packages, look at what's in them, build an index, and then maintain it. (Ubuntu does something similar for their \"it looks like you typed \"less\" and it isn't installed, maybe you want \"apt install less\"\" messages.) An index like this would be pretty handy for lots of purposes, even...\r\n\r\nThis would definitely be valuable. I'll start a background thread for it.\r\n\r\nThere's a metadata field on PyPI for precisely this: 'provides' can indicate the modules and packages in a distribution. Of course, tools (besides flit) don't fill it automatically, and no-one creating packages knows about its existence. :-("}}
{"actor":{"display_login":"takluyver"}}