{"action":"created","issue":{"url":"https://api.github.com/repos/gibiansky/IHaskell/issues/566","labels_url":"https://api.github.com/repos/gibiansky/IHaskell/issues/566/labels{/name}","comments_url":"https://api.github.com/repos/gibiansky/IHaskell/issues/566/comments","events_url":"https://api.github.com/repos/gibiansky/IHaskell/issues/566/events","html_url":"https://github.com/gibiansky/IHaskell/issues/566","id":103714494,"number":566,"title":"Support installing IHaskell kernel into a virtualenv","user":{"login":"samdoshi","id":112490,"avatar_url":"https://avatars.githubusercontent.com/u/112490?v=3","gravatar_id":"","url":"https://api.github.com/users/samdoshi","html_url":"https://github.com/samdoshi","followers_url":"https://api.github.com/users/samdoshi/followers","following_url":"https://api.github.com/users/samdoshi/following{/other_user}","gists_url":"https://api.github.com/users/samdoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/samdoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdoshi/subscriptions","organizations_url":"https://api.github.com/users/samdoshi/orgs","repos_url":"https://api.github.com/users/samdoshi/repos","events_url":"https://api.github.com/users/samdoshi/events{/privacy}","received_events_url":"https://api.github.com/users/samdoshi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-28T12:56:23Z","updated_at":"2015-08-28T19:55:52Z","closed_at":null,"body":"Jupyter has the option to install a kernel into a prefix directory instead of the user directory:\r\n\r\n```jupyter kernelspec install -h```\r\n```\r\n...\r\n--user\r\n    Install to the per-user kernel registry\r\n--replace\r\n    Replace any existing kernel spec with this name.\r\n--prefix=<Unicode> (InstallKernelSpec.prefix)\r\n    Default: ''\r\n    Specify a prefix to install to, e.g. an env. The kernelspec will be\r\n    installed in PREFIX/share/jupyter/kernels/\r\n...\r\n```\r\nThe main use-case would be for installing a kernel inside a virtualenv as jupyter will add `{sys.prefix}/share/jupyter` to it's [data paths](http://jupyter.readthedocs.org/en/latest/system.html#data-files).\r\n\r\nWould it be possible to update the `ihaskell install` command to accept a `--prefix` option to support this? \r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26275225-support-installing-ihaskell-kernel-into-a-virtualenv?utm_campaign=plugin&utm_content=tracker%2F332399&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F332399&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/gibiansky/IHaskell/issues/comments/135872934","html_url":"https://github.com/gibiansky/IHaskell/issues/566#issuecomment-135872934","issue_url":"https://api.github.com/repos/gibiansky/IHaskell/issues/566","id":135872934,"user":{"login":"samdoshi","id":112490,"avatar_url":"https://avatars.githubusercontent.com/u/112490?v=3","gravatar_id":"","url":"https://api.github.com/users/samdoshi","html_url":"https://github.com/samdoshi","followers_url":"https://api.github.com/users/samdoshi/followers","following_url":"https://api.github.com/users/samdoshi/following{/other_user}","gists_url":"https://api.github.com/users/samdoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/samdoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdoshi/subscriptions","organizations_url":"https://api.github.com/users/samdoshi/orgs","repos_url":"https://api.github.com/users/samdoshi/repos","events_url":"https://api.github.com/users/samdoshi/events{/privacy}","received_events_url":"https://api.github.com/users/samdoshi/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T19:55:52Z","updated_at":"2015-08-28T19:55:52Z","body":"It appears you can't use `--user` and `--prefix` at the same time\r\n\r\n```sh\r\nstack exec ihaskell -- install --prefix=env`\r\n```\r\n```\r\n...\r\nException: error running: /Users/sam/Scratch/ihaskell-in-a-virtualenv/env/bin/ipython kernelspec install --user /var/folders/g2/f3hmstnx0_df9nvmd5mz4phc0000gn/T/tmpThreadId416807282475249/haskell --replace --prefix env\r\nexit status: 1\r\nstderr: Can't specify both user and prefix. Please choose one or the other.\r\n```\r\n\r\nFor you reference:\r\n```sh\r\nstack new ihaskell-in-a-virtualenv simple\r\ncd ihaskell-in-a-virtualenv\r\n```\r\nYou'll need to update the `stack.yaml` file:\r\n```sh\r\ncat stack.yaml\r\n```\r\n```yaml\r\nflags: {}\r\npackages:\r\n    - '.'\r\n    - location:\r\n        git: git@github.com:gibiansky/IHaskell.git\r\n        commit: fe89d49748ad10be7f668add04fd03771f619473\r\n        valid-wanted: false\r\nextra-deps:\r\n    - ipython-kernel-0.7.0.0\r\nresolver: lts-3.2\r\n```\r\n```sh\r\nstack build\r\nvirtualenv env\r\nsource env/bin/activate\r\npip install jupyter==1.0.0\r\nstack exec ihaskell -- install --prefix=env\r\njupyter --paths\r\njupyter notebook\r\n```\r\n\r\nOnce you've got it working (I'd help but I've only been learning haskell for a few months now), I'd be more than happy to write something up a bit more proper to include in the readme."}}