Is it possible to run Python without installation (without using packagers like py2exe)?
<p>We have a complex tool (coded in Python) for environment validation and configuration. It runs on various Windows flavors. We used this tool within the company so far. However now we want our support engineers to use it on the road. The problem is they will not have permissions to install Python in customer machines.</p>

<p>To address this situation, we looked at utilities like py2exe, cx_freeze and pyInstaller. While they are good, the generated EXE runs into dependency issues in some situations. So we dropped using these tools.</p>

<p>Is it possible to take all python related files in a pen drive and run it directly from it? When we do that, obviously the interpreter complains because the DLLs are not registered on the target machine. I suspect just registering the DLLs may lead to other problems. Is there a simple solution to this?</p>

<p>Suppose your script is <code>main.py</code>, </p>

<ul>
<li>copy all the contents of python directory to the directory it reside in </li>
<li>search <code>python*.dll</code> in your windows directory and it to <code>project/python</code></li>
<li>create <code>project/main.bat</code>:</li>
</ul>

<p><strong>main.bat</strong></p>

<pre><code>"%~dp0/python/python.exe" "%~dp0/main.py" %*
</code></pre>

<p>The project directory should be:</p>

<pre><code>project
âââ python
|   âââ python.exe
|   âââ python27.dll
|   âââ ...
âââ main.py
âââ main.bat
</code></pre>

<p>Now, invoke the program with <code>main.bat</code></p>

python dll installation python-standalone