pyvenv environments not usable without activation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python3.3 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
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(
['', '/usr/lib/
When I create a test module, I cannot import it:
$ echo 'print("Hello")' > venv/lib/
$ 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_
['', '/usr/lib/
$ VIRTUAL_
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:/
- https:/
Versions:
Ubuntu 13.10
Python 3.3.2-7ubuntu3.1
---
ApportVersion: 2.12.5-0ubuntu2.2
Architecture: amd64
DistroRelease: Ubuntu 13.10
InstallationDate: Installed on 2012-04-14 (713 days ago)
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427)
MarkForUpload: True
Package: python3.3 3.3.2-7ubuntu3.1
PackageArchitec
ProcVersionSign
Tags: saucy
Uname: Linux 3.8.0-22-generic x86_64
UpgradeStatus: Upgraded to saucy on 2013-10-18 (161 days ago)
UserGroups:
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