I
I
iandriyanov2014-02-15 12:08:17
Python
iandriyanov, 2014-02-15 12:08:17

Python-virtualenv, where are the standard modules?

Good afternoon.
Tell me, why, when creating a new environment, the standard modules of the system, which, in theory, go together with the interpreter, are not transferred?
Namely threading and _thread. Those. if I create an environment:
virtualenv --python=python3 NAME
And import the module in this environment:

python -c "import threading; print(threading.__file__)"
/usr/lib/python3.2/threading.py

I receive the response of the imported module from the global environment. This happens even when virtualenv --no-site-packages.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
leclecovich, 2014-02-15
@leclecovich

To quote from the documentation: "It creates an environment that has its own installation directories, that doesn't share libraries with other virtualenv environments (and optionally doesn't access the globally installed libraries either)."
Reading further, we find www.virtualenv.org/en/latest/virtualenv.html#using... . Profit!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question