[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2021-12-08 Thread Nathan Jensen
Change by Nathan Jensen : -- nosy: +ndjensen ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2021-01-06 Thread STINNER Victor
STINNER Victor added the comment: See also "Configure Python initialization (PyConfig) in Python" https://mail.python.org/archives/list/python-...@python.org/thread/HQNFTXOCDD5ROIQTDXPVMA74LMCDZUKH/#X45X2K4PICTDJQYK3YPRPR22IGT2CDXB And bpo-42260: [C API] Add PyInterpreterState_SetConfig():

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2021-01-05 Thread Andrew Brunner
Change by Andrew Brunner : -- nosy: +abrunner73 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2020-04-15 Thread Graham Dumpleton
Graham Dumpleton added the comment: For the record. Since virtualenv 20.0.0 (or there about) switched to the python -m venv style virtual environment structure, the C API for embedding when using a virtual environment is now completely broken on Windows. The same workaround used on UNIX

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2020-02-19 Thread Henning von Bargen
Henning von Bargen added the comment: As a side-note: In my case I am embedding Python in a C program for several reasons: - Added an additional module (generated with SWIG) - This module needs a licence key, which I supply in the C program (to make it more difficult to extract it). - I need

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2020-02-19 Thread Henning von Bargen
Change by Henning von Bargen : -- nosy: +Henning.von.Bargen ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2020-02-12 Thread Steve Dower
Steve Dower added the comment: > I run into this issue when embedding CPython in a Windows app, and want to > use some pre-installed Python, which is not part of the install package... You'll run into many more issues if you keep doing this... The way to use a pre-installed Python on

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2020-02-07 Thread Leslie
Leslie added the comment: I just can say that sorting this issue (and PEP-0432) out would be great! I run into this issue when embedding CPython in a Windows app, and want to use some pre-installed Python, which is not part of the install package... So beside pyenv venvs, please keep Windows

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2020-01-09 Thread Milo D Kerr
Change by Milo D Kerr : -- nosy: +M.Kerr ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-10-17 Thread PyScripter
PyScripter added the comment: To Steve: I want the embedded venv to have the same sys.path as if you were running the venv python interpreter. So my method takes into account for instance the include-system-site-packages option in pyvenv.cfg. Also my method sets sys.prefix in the same

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-10-17 Thread Steve Dower
Steve Dower added the comment: If you just want to be able to import modules from the venv, and you know the path to it, it's simpler to just do: import sys sys.path.append(r"path to venv\Lib\site-packages") Updating sys.executable is only necessary if you're going to use libraries

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-10-17 Thread PyScripter
PyScripter added the comment: Just in case this will be of help to anyone, I found a way to use venvs in embedded python. - You first need to Initialize python that is referred as home in pyvenv.cfg. - Then you execute the following script: import sys sys.executable = r"Path to the python

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-09-20 Thread PyScripter
PyScripter added the comment: To Victor: So how does the implementation of PEP-587 help configure embedded python with venv? It would be great help to provide some minimal instructions. -- nosy: +pyscripter ___ Python tracker

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-05-27 Thread STINNER Victor
STINNER Victor added the comment: I wrote the PEP 587 "Python Initialization Configuration" which has been accepted. It allows to completely override the "Path Configuration". I'm not sure that it fully implementation what it requested here, but it should now be easier to tune the Path

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-27 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-36142: "Add a new _PyPreConfig step to Python initialization to setup memory allocator and encodings". -- ___ Python tracker

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-20 Thread INADA Naoki
Change by INADA Naoki : -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-16 Thread Nick Coghlan
Nick Coghlan added the comment: Since I haven't really written them down anywhere else, noting some items I'm aware of from the Python 3.7 internals work that haven't made their way back into the PEP 432 public API proposal yet: * If we only had to care about the pure embedding case, this

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-16 Thread Nick Coghlan
Nick Coghlan added the comment: Note also that Eric and I haven't failed to agree with Victor on an API, as Victor hasn't actually written a concrete proposal *for* a public API (neither as a PR updating PEP 432, nor as a separate PEP). The current implementation does NOT follow the PEP as

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-16 Thread Nick Coghlan
Nick Coghlan added the comment: Steve, you're describing the goals of PEP 432 - design the desired API, then write the code to implement it. So while Victor's goal was specifically to get PEP 540 implemented, mine was just to make it so working on the startup sequence was less awful (and in

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-15 Thread Eric Snow
Eric Snow added the comment: On Wed, Feb 13, 2019 at 5:09 PM Steve Dower wrote: > This is why I'm keen to design the ideal *user* API first (that is, write the > examples of how you would use it) and then figure out how we can make it fit. > It's kind of the opposite approach from what

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-15 Thread Eric Snow
Eric Snow added the comment: On Wed, Feb 13, 2019 at 10:56 AM Steve Dower wrote: > Nick, Victor, Eric, (others?) - are you interested in having a virtual > whiteboard session to brainstorm how the "perfect" initialization looks? And > probably a follow-up to brainstorm how to get there

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-13 Thread Steve Dower
Steve Dower added the comment: Thanks, Victor, that's great information. > Memory allocator, context, different structures for configuration... it's > really not an easy topic :-( There are so many constraints put into a single > API! This is why I'm keen to design the ideal *user* API

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-13 Thread STINNER Victor
STINNER Victor added the comment: > It seems that the disagreement about the design is fundamentally a > disagreement between a "quick, painful but complete fix" and "slow, careful > improvements with a transition period". Both are valid approaches, and since > Victor is putting actual

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-13 Thread Steve Dower
Steve Dower added the comment: I just closed 35706 as a duplicate of this one (the titles are basically identical, which feels like a good hint ;) ) It seems that the disagreement about the design is fundamentally a disagreement between a "quick, painful but complete fix" and "slow, careful

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-13 Thread STINNER Victor
STINNER Victor added the comment: PEP 432 will allow to give with fine control on parameters used to initialize Python. Sadly, I failed to agree with Nick Coghlan and Eric Snow on the API. The current implementation (_PyCoreConfig and _PyMainInterpreterConfig) has some flaw (don't separate

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-07 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I mainly cc'ed Victor and Eric since making this easier ties into one of the original design goals for PEP 432 (even though I haven't managed to persuade either of them to become co-authors of that PEP yet). --

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-06 Thread Steve Dower
Steve Dower added the comment: Victor may be thinking about it from time to time (or perhaps it's time to make the rest of the configuration changes plans concrete so we can all help out?), but I'd like to see this as either: * a helper function to fill out the core config structure from a

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-02-06 Thread Nick Coghlan
Nick Coghlan added the comment: (Added Victor, Eric, and Steve to the nosy list here, as I'd actually forgotten about this until issue #35706 reminded me) Core of the problem: the embedding APIs don't currently offer a Windows-compatible way of setting up "use this base Python and this venv

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2014-08-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: That workaround would definitely deserve being wrapped in a higher-level API invokable by embedding applications, IMHO. -- nosy: +pitrou versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2014-08-23 Thread Nick Coghlan
Nick Coghlan added the comment: Excellent! If I recall correctly, that works because we resolve the symlink when looking for the standard library, but not when looking for venv configuration file. I also suspect this is all thoroughly broken on Windows - there are so many configuration

[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2014-08-23 Thread Graham Dumpleton
Graham Dumpleton added the comment: I only make the change to Py_SetProgramName() on UNIX and not Windows. This is because back in mod_wsgi 1.0 I did actually used to use Py_SetProgramName() but it didn't seem to work in sane way on Windows so changed to Py_SetPythonHome() which worked on