embedding Pyd in Windows program

Ellery Newcomer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Mar 12 18:40:34 PDT 2015


On 03/11/2015 07:59 PM, Matt wrote:
>
> Right, copying site.py into my program's working dir sorts out the
> missing module error, but I now get a syntax error:
>
>      file=sys.stderr)
>          ^
> SyntaxError: invalid syntax
> Error executing command run: Program exited with code 1
>
> I googled this, and apparently it's caused by an older interpreter. The
> only files I have transferred over are:
>    python3.DLL
>    python3.LIB
>    python34.LIB
>
> Does anyone have any idea what I might be doing wrong, or how I can fix
> this?

I'm guessing your python path is screwed up. In your embedded python,

import sys
print (sys.path)

make sure everything is pointing where it should.

Failing that,

are you using the correct dub configuration? without checking, I believe 
it defaults to python 2.7.

Failing that,

you transferred python3.dll from somewhere to somewhere? I believe pyd 
links to \windows\system32\python3.dll or some such. At least, I think 
that's where those lib files point to. not sure. If that is an issue and 
you want to use your own lib files, you will need to generate OMF files 
from them.




More information about the Digitalmars-d-learn mailing list