A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20150909/75a6caa1/attachment.html below:

<div dir="ltr">A good overview on this topic is given on <a href="https://github.com/numpy/numpy/wiki/windows-dll-notes">https://github.com/numpy/numpy/wiki/windows-dll-notes</a>. As a side note the PATH is usually the latest place in the search order of DLLs. Pre-loading python35.dll into the process space from within vim could be a possible solution.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-09 16:30 GMT+02:00 Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">First of all, an apology. I know this is probably going to be of<br>
limited interest for many on python-dev, but I'm honestly not sure<br>
where there's a better audience for the question. As it's related to<br>
how people should use the new "embeddable" distribution of Python 3.5,<br>
I'm hoping it's sufficiently relevant - but if not, feel free to<br>
direct me to a better forum.<br>
<br>
I've been trying to use the new embeddable distribution to build a<br>
Windows installation of vim that includes a Python interpreter, rather<br>
than relying on the user having a system install of Python on PATH.<br>
This strikes me as precisely the sort of usage that the embeddable<br>
distribution would be great for. And indeed, it works fine for that.<br>
But when it comes to distribution, I have an issue.<br>
<br>
The problem is that for vim to find the Python DLL, it needs to be<br>
alongside vim.exe (there's a small complication here I'll come to<br>
later, but let's ignore that for now). So I unzip the embeddable<br>
distribution into the directory containing vim.exe.<br>
<br>
However, I want that directory on PATH (so I can run vim from the<br>
command line). Now, as the embeddable distribution includes<br>
python.exe, this pollutes my PATH with an extra copy of python, which<br>
may or may not be picked up in preference to my "real" python,<br>
depending on how I install python. That's bad - I can delete<br>
python.exe and pythonw.exe from my vim installation, but I still have<br>
a load of Python DLLs on PATH that could potentially mess up other<br>
Python installations on my machine (I honestly don't know how likely<br>
that is, particularly if I distribute my vim build to other users with<br>
different setups).<br>
<br>
What I'd like to do is to put the Python stuff in a subdirectory of<br>
the Vim installation, so it's safely isolated. In the case of vim, I<br>
can do this, as vim has an option to dynamically load the Python DLL<br>
via LoadLibrary, and I can patch vim to look in <vim dir>\python<br>
before searching PATH. But the LoadLibrary stuff is horribly fragile,<br>
and I doubt anyone else embedding Pthon in their application is likely<br>
to do that - they will probably just link to python35.dll at<br>
load-time.<br>
<br>
I'm not aware of any way to adjust the loader's search path for DLLs<br>
to include a subdirectory that's not on PATH, so it seems to me that<br>
there's no good way to avoid having the embeddable distribution<br>
visible via the user's PATH.<br>
<br>
For vim, I'll probably go for the dynamic loading approach with a<br>
patch to look in a subdirectory. But have I missed any other<br>
approaches that make an embedded Python more isolated from the user's<br>
system?<br>
<br>
Paul<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/cmkleffner%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/cmkleffner%40gmail.com</a><br>
</blockquote></div><br></div>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4