#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    9
    Rep Power
    0

    Call python from c


    I run c-application on computer, where python installed before.
    But when I try to run this application on other computer without
    python installation I have got the following error:
    Py_Initialize: unable to load the file system codex.
    Import error: no module named encoding.
    It is clear that Py_Initialize tries to start Enterpreter, but I. Think there
    exist the DLL, that possible to call its functions indirectly.
    But I Don not how to do it.
    I hope anybody may help me.
    Thanks in advance
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    39
    Rep Power
    2
    I'm guessing by the way you say DLL you are using Windows.

    There is a pythonxx.dll (where xx is the version) in the %windir%\System32 directory. So if you are using Python 2.7 on a default setup the file is C:\Windows\System32\python27.dll

    This is just the base Python so you may still see errors about being unable to laod modules. The Python on Windows FAQ in the Python documentation has more details.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    9
    Rep Power
    0
    I tried also to work with python33. DLL, but it is not helped.
    I added even system var. Pythonioencoding=utf-8,
    but also without good results.

IMN logo majestic logo threadwatch logo seochat tools logo