{"action":"created","issue":{"url":"https://api.github.com/repos/jorgenschaefer/pyvenv/issues/37","labels_url":"https://api.github.com/repos/jorgenschaefer/pyvenv/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/jorgenschaefer/pyvenv/issues/37/comments","events_url":"https://api.github.com/repos/jorgenschaefer/pyvenv/issues/37/events","html_url":"https://github.com/jorgenschaefer/pyvenv/issues/37","id":114099555,"number":37,"title":"Environment Broken","user":{"login":"elemakil","id":3091695,"avatar_url":"https://avatars.githubusercontent.com/u/3091695?v=3","gravatar_id":"","url":"https://api.github.com/users/elemakil","html_url":"https://github.com/elemakil","followers_url":"https://api.github.com/users/elemakil/followers","following_url":"https://api.github.com/users/elemakil/following{/other_user}","gists_url":"https://api.github.com/users/elemakil/gists{/gist_id}","starred_url":"https://api.github.com/users/elemakil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elemakil/subscriptions","organizations_url":"https://api.github.com/users/elemakil/orgs","repos_url":"https://api.github.com/users/elemakil/repos","events_url":"https://api.github.com/users/elemakil/events{/privacy}","received_events_url":"https://api.github.com/users/elemakil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jorgenschaefer/pyvenv/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-29T17:09:16Z","updated_at":"2015-10-29T17:40:38Z","closed_at":null,"body":"I'm using an environment with a `postactivate` hook given by `virtualenvwrapper`. This hook sets some environment variables (e.g. `PYTHONPATH`) required for executing the code I am developing.\r\n\r\nI am using a `.dir-locals.el` file at the base on my project with the following config:\r\n```\r\n((python-mode\r\n  (eval ignore-errors\r\n        \"Setup python environment variables.\"\r\n        (make-local-variable 'process-environment)\r\n        (setq process-environment\r\n              (append process-environment\r\n                      '(\"PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages\"\r\n                        \"VIRTUALENVWRAPPER_ENV_BIN_DIR=bin\"\r\n                        \"VIRTUALENVWRAPPER_HOOK_DIR=/Users/elemakil/.virtualenvs\"\r\n                        \"VIRTUALENVWRAPPER_PYTHON=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python\"\r\n                        \"VIRTUALENVWRAPPER_SCRIPT=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh\"\r\n                        \"VIRTUALENVWRAPPER_VIRTUALENV=virtualenv\"))))))\r\n```\r\nAs expected, this modifes the variables relevant for the hook procedure (`VIRTUALENVWRAPPER_*`) only for the relevant buffers. However, when loading the environment using `pyvenv` (`pyvnev-workon`), these variables are not used. \r\n\r\nFor debugging, I've put an echo statement into the `pyvenv-run-virtualenvwrapper-hook` function [L 370-2]:\r\n```\r\n(call-process-shell-command\r\n               (format \". '%s' ; echo \\\"PYTHONPATH = '$PYTHONPATH'\\\" >> /Users/elemakil/foo ; echo \\\"VIRTUALENVWRAPPER_HOOK_DIR = '$VIRTUALENVWRAPPER_HOOK_DIR\\\" >> /Users/elemakil/foo ; echo ; echo =-=-= ; python -c \\\"import os, json ; print(json.dumps(dict(os.environ)))\\\"\"\r\n                       tmpfile)\r\n               nil t nil)\r\n```\r\nBoth variables are empty. Consequently, an interactive session started from within `emacs` will fail to work correctly since the code in the hook is not executed.\r\n\r\nPlease advise!\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jorgenschaefer/pyvenv/issues/comments/152260882","html_url":"https://github.com/jorgenschaefer/pyvenv/issues/37#issuecomment-152260882","issue_url":"https://api.github.com/repos/jorgenschaefer/pyvenv/issues/37","id":152260882,"user":{"login":"jorgenschaefer","id":2500270,"avatar_url":"https://avatars.githubusercontent.com/u/2500270?v=3","gravatar_id":"","url":"https://api.github.com/users/jorgenschaefer","html_url":"https://github.com/jorgenschaefer","followers_url":"https://api.github.com/users/jorgenschaefer/followers","following_url":"https://api.github.com/users/jorgenschaefer/following{/other_user}","gists_url":"https://api.github.com/users/jorgenschaefer/gists{/gist_id}","starred_url":"https://api.github.com/users/jorgenschaefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorgenschaefer/subscriptions","organizations_url":"https://api.github.com/users/jorgenschaefer/orgs","repos_url":"https://api.github.com/users/jorgenschaefer/repos","events_url":"https://api.github.com/users/jorgenschaefer/events{/privacy}","received_events_url":"https://api.github.com/users/jorgenschaefer/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T17:40:38Z","updated_at":"2015-10-29T17:40:38Z","body":"Wow, nice catch!"}}