Skip to content
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

Test for whether inside virtualenv does not work if directory is symlinked #4486

Closed
tcorbettclark opened this issue Nov 4, 2013 · 1 comment · Fixed by #4489
Closed

Test for whether inside virtualenv does not work if directory is symlinked #4486

tcorbettclark opened this issue Nov 4, 2013 · 1 comment · Fixed by #4489
Milestone

Comments

@tcorbettclark
Copy link

The following test for whether IPython is running inside a virtualenv does not work if the python executable and the VIRTUAL_ENV variable are at the same place but one is at a symlinked path to the other:

if sys.executable.startswith(os.environ['VIRTUAL_ENV']):

Discovered when using invewrapper, but problem appears more generic: pew-org/pew#8

tcorbettclark@cmed1:~$ python -c "import IPython; print(IPython.sys_info())"
{'codename': 'An Afternoon Hack',
 'commit_hash': '7c2ea3a',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/home/tcorbettclark/.virtualenvs/ice/local/lib/python2.7/site-packages/IPython',
 'ipython_version': '1.1.0',
 'os_name': 'posix',
 'platform': 'Linux-3.5.0-42-generic-x86_64-with-Ubuntu-12.10-quantal',
 'sys_executable': '/home/tcorbettclark/.virtualenvs/ice/bin/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.3 (default, Sep 26 2013, 16:35:25) \n[GCC 4.7.2]'}
tcorbettclark@cmed1:~$ 
@minrk
Copy link
Member

minrk commented Nov 4, 2013

Can you try #4489?

@minrk minrk added this to the 2.0 milestone Mar 26, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
should help with symlinked envs

closes ipython#4486
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants