[Tutor] Does the user need to install Python, when we deploy our c++ products using python?

James Chapman james at uplinkzero.com
Thu Dec 11 12:42:38 CET 2014


Actually, after re-reading your original message I think I misunderstood
and went off on a tangent.

If you are embedding python into a C++ app, then you will need the dlls and
all of the compiled python code. *.pyc. (Well most, not all). The exact
location of these files in the final build I'm unsure of.



--
James

On 11 December 2014 at 11:39, James Chapman <james at uplinkzero.com> wrote:

>
> On 2 December 2014 at 20:28, gordon zhang <zhanggordon999 at gmail.com>
> wrote:
>
>>
>>
>> I downloaded python 3.4.2 for c++ and create a vc++ project using python,
>> but I have no idea what python dlls and other stuff needed to deploy the
>> products.
>>
>> I know if we put Python34.dll and Python.dll in the folder of executable,
>> it is not enough. What else do we need to put in the folder of
>> executable?(the application does not run)
>>
>> If anyone knows please let me know.
>>
>> Thanks, Gordon
>>
>
> Probably a little advanced for this list but the list is here to learn
> right? So my own 2 pence worth...
>
> Are you referring to Python Tools for Visual Studio?
> http://pytools.codeplex.com/
>
> This allows you to build python projects in VS and then debug them using
> the VS debugger, but you will need the debug files (.pdb) available on this
> page: https://www.python.org/downloads/windows/ - This however is more
> for extending python via C/C++ than building python apps or using python to
> deploy apps.
>
> There are a number of tools out there, some already mentioned for bundling
> python apps into exe's which then require the python dlls to be packaged in
> an installer to be deployed with your newly built exe. I have done this in
> the past and experience has taught me one thing. Don't do it! You end up
> making your app way too complex, and it becomes very difficult to support.
> Also, when you want to update the python environment you run into problems.
> From someone who has been there, don't do it. Even if you have CI
> infrastructure in place to make things easily repeatable, it still becomes
> a nightmare.
>
> Rather find an automated way of deploying python independently and then
> use an installer to install just your python code. That way all you support
> is your code, you don't end up supporting 3rd party wrappers that don't
> work properly.
>
> nullsoft scriptable installer is easy to use, has good documentation and
> examples, and doesn't have a massively steep learning curve.
> http://nsis.sourceforge.net/Main_Page
>
>
>


More information about the Tutor mailing list