FAQ
Hi,

I'm trying to embed python in a c++ program.
I have compiled python32.lib with msvc 2010 targetting 32bits, i link
it with my program wich is also 32bit.
I get an error when calling Py_Initialize() : "no codec search
functions registered: can't find encoding"

Py_FileSystemDefaultEncoding value is "mbcs".

_PyCodec_Lookup raise an eror because len = PyList_Size(interp-
codec_search_path); returns 0 in codecs.c
Does someone already had this problem ? I have no idea how to solve
that.

Sorry for my bad english.

Search Discussions

  • Mathieu CLERICI at Feb 28, 2011 at 12:04 pm
    Precisions : I'm trying to embed python 3.2 release.
  • Swapnil at Mar 1, 2011 at 2:03 pm

    On Feb 28, 4:57?pm, Mathieu CLERICI wrote:
    Hi,

    I'm trying to embed python in a c++ program.
    I have compiled python32.lib with msvc 2010 targetting 32bits, i link
    it with my program wich is also 32bit.
    I get an error when calling Py_Initialize() : "no codec search
    functions registered: ?can't find encoding"

    Py_FileSystemDefaultEncoding value is "mbcs".

    _PyCodec_Lookup raise an eror because ?len = PyList_Size(interp-
    codec_search_path); returns 0 in codecs.c
    Does someone already had this problem ? I have no idea how to solve
    that.

    Sorry for my bad english.
    While initializing python import site.py module and I think
    subsequently several other modules. Probably its in this process that
    Python is trying to register the codes from the encoding package of
    standard library. You must provide the path to the standard library to
    the exe that you generate. You can do this by setting the environment
    variables PYTHONPATH, PYTHONHOME (Refer
    http://docs.python.org/using/cmdline.html#environment-variables ) in
    your program before calling Py_Initialize()

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedFeb 28, '11 at 11:57a
activeMar 1, '11 at 2:03p
posts3
users2
websitepython.org

2 users in discussion

Mathieu CLERICI: 2 posts Swapnil: 1 post

People

Translate

site design / logo © 2023 Grokbase