Mario <mariofut...@gmail.com> added the comment:

On 10/10/2018 01:11, Steve Dower wrote:
> 
> Steve Dower <steve.do...@python.org> added the comment:
> 
> We'll need to bring in venv specialists to check whether using it outside of 
> Py_Main() is valid. Or perhaps you could explain what you are actually trying 
> to do?
> 

Sure

1) Create a virtual environment ("python -m venv")
2) Activate
2) Pip install some modules
3) Try to use them form inside an embedded application (e.g. the one I attached)
4) Do it in Linux and Windows

Result

Works in Linux, fails in Windows.

Reason in site.py

https://github.com/python/cpython/blob/73870bfeb9cf350d84ee88bd25430c104b3c6191/Lib/site.py#L462

sys.executable is used to construct the correct search path.

Looking at the sys.path from inside an embedded application is very instructive 
and you can see in 
the first post why the failure in windows.

Andrea

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34725>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to