[Bug 1298831] Re: pyvenv environments not usable without activation

Jörg Frings-Fürst ubuntu at jff-webhosting.net
Fri Mar 28 10:36:02 UTC 2014


Hi,

we need some more information. From a terminal window please run:

sudo apport-collect 1298831

and then change the status of the bug to 'Confirmed'.

Jörg


** Changed in: python3.3 (Ubuntu)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python3.3 in Ubuntu.
https://bugs.launchpad.net/bugs/1298831

Title:
  pyvenv environments not usable without activation

Status in “python3.3” package in Ubuntu:
  Incomplete

Bug description:
  Virtual environments created with pyvenv are supposed to be usable without 'activation', according to Python's docs.
  With Ubuntu's Python 3.3 packages, however, the sys.path is incomplete unless the environment variable VIRTUAL_ENV is set.

  $ cd /tmp
  $ pyvenv-3.3 venv
  $ venv/bin/python -c 'import sys;print(sys.path)'
  ['', '/usr/lib/python3.3', '/usr/lib/python3.3/plat-x86_64-linux-gnu', '/usr/lib/python3.3/lib-dynload']

  When I create a test module, I cannot import it:
  $ echo 'print("Hello")' > venv/lib/python3.3/site-packages/hello.py
  $ venv/bin/python -c 'import hello'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  ImportError: No module named 'hello'

  When I set VIRTUAL_ENV (simulating activation), the sys.path is
  complete and it works:

  $ VIRTUAL_ENV=/tmp/venv venv/bin/python -c 'import sys;print(sys.path)'
  ['', '/usr/lib/python3.3', '/usr/lib/python3.3/plat-x86_64-linux-gnu', '/usr/lib/python3.3/lib-dynload', '/tmp/venv/lib/python3.3/site-packages']
  $ VIRTUAL_ENV=/tmp/venv venv/bin/python -c 'import hello'
  Hello

  The latter output is what I also get with a Python manually compiled
  from sources, but even without the VIRTUAL_ENV variable being set.

  This may be related:
  - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=695758
  - https://bugs.launchpad.net/ubuntu/+source/python3.3/+bug/1093193

  Versions:
  Ubuntu 13.10
  Python 3.3.2-7ubuntu3.1

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3.3/+bug/1298831/+subscriptions



More information about the foundations-bugs mailing list