Hyphenation module PyHyphen-0.3 released

Discussion in 'Python' started by Dr. leo, Feb 23, 2008.

  1. Dr. leo

    Dr. leo Guest

    I am pleased to share with you the great features of the latest version.
    Large parts of the sources were completely rewritten. Also, they are now
    reasonably documented.

    Just go to
    http://pypi.python.org/pypi/PyHyphen/0.3

    I was tempted to classify it as Beta. Indeed I am not aware of any bugs, but
    I haven't spent very much time for testing, just ran some word lists...

    Any feedback is greatly appreciated. Especially I would be interested in
    experiences under Windows. I can only test it under Linux.

    If there were a good soul to send me a DLL for Windows
    () , this would be terrific.

    Bests

    Leo
    Dr. leo, Feb 23, 2008
    #1
    1. Advertising

  2. Dr. leo

    thebjorn Guest

    On Feb 23, 8:35 pm, "Dr. leo" <> wrote:
    > I am pleased to share with you the great features of the latest version.
    > Large parts of the sources were completely rewritten. Also, they are now
    > reasonably documented.
    >
    > Just go tohttp://pypi.python.org/pypi/PyHyphen/0.3
    >
    > I was tempted to classify it as Beta. Indeed I am not aware of any bugs, but
    > I haven't spent very much time for testing, just ran some word lists...
    >
    > Any feedback is greatly appreciated. Especially I would be interested in
    > experiences under Windows. I can only test it under Linux.
    >
    > If there were a good soul to send me a DLL for Windows
    > () , this would be terrific.
    >
    > Bests
    >
    > Leo


    Looks interesting, and I'd love to provide a .pyd file, however I'm
    running into some problems :-( I've got VS 2005 on this machine and
    setup-tools is complaining about my Python being built with VS 2003.
    (I know what the problem is with intermingling runtime libraries, yet
    I can't downgrade my VS version...) I got a message that I could try
    using mingw32, so a quick download and the build step seemed to finish
    without any problems:

    C:\work\PyHyphen-0.3>python setup.py build -c mingw32
    running build
    running build_py
    running build_ext
    running build_scripts
    creating build\scripts-2.5
    copying example.py -> build\scripts-2.5

    (I ran build_ext first, which is why there's so little output.) I
    copied the dictionary into build\lib.win32-2.5\dict and was able to
    import the library without getting any errors and run the example from
    http://pypi.python.org/pypi/PyHyphen/0.3 (from the build directory).
    I'm stuck at trying to install the package though...:

    C:\work\PyHyphen-0.3>python setup.py install
    running install
    running build
    running build_py
    running build_ext
    error: Python was built with Visual Studio 2003;
    extensions must be built with a compiler than can generate
    compatible binaries.
    Visual Studio 2003 was not found on this system. If you have Cygwin
    installed,
    you can try compiling with MingW32, by passing "-c mingw32" to
    setup.py.

    C:\work\PyHyphen-0.3>python setup.py install -c mingw32
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2
    [cmd2_opts] ...]
    or: setup.py --help [cmd1 cmd2 ...]
    or: setup.py --help-commands
    or: setup.py cmd --help

    error: invalid command 'mingw32'

    I don't know if I'm just doing it wrong, or if I can't use extensions
    compiled with mingw32 with the standard distribution Python
    executable?

    -- bjorn
    thebjorn, Feb 24, 2008
    #2
    1. Advertising

  3. Dr. leo

    Max Erickson Guest

    thebjorn <> wrote:
    > Visual Studio 2003 was not found on this system. If you have
    > Cygwin
    > installed,
    > you can try compiling with MingW32, by passing "-c mingw32" to
    > setup.py.
    > -- bjorn


    You need to convince MingW to use the correct VS runtime. Cribbing
    from:

    http://www.develer.com/oss/GccWinBinaries

    the easy way to do this might be to find(in your mingw /lib directory)
    and copy or rename libmsvcr71.a and libmsvcr71d.a into libmsvcrt.a and
    libmsvcrtd.a (backing up the originals if desired). If the MingW you
    have installed doesn't provide the appropriate runtime, you would have
    to track that down.

    The MingW/GCC package from the linked page provides a utility to do
    this, but it is a tossup/up to you if the version of GCC provided is
    suitable for 'production' use.


    max
    Max Erickson, Feb 24, 2008
    #3
  4. > On Behalf Of Max Erickson
    > the easy way to do this might be to find(in your mingw /lib
    > directory) and copy or rename libmsvcr71.a and libmsvcr71d.a
    > into libmsvcrt.a and libmsvcrtd.a (backing up the originals
    > if desired). If the MingW you have installed doesn't provide
    > the appropriate runtime, you would have to track that down.


    Here's another way. Go to /MinGW/lib/gcc/mingw32/3.4.2/spec, and modify the
    libgcc directive as follows:

    *libgcc:
    %{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcr71

    Regards,
    Ryan Ginstrom
    Ryan Ginstrom, Feb 24, 2008
    #4
  5. > I don't know if I'm just doing it wrong, or if I can't use extensions
    > compiled with mingw32 with the standard distribution Python
    > executable?


    I was able to install on Windows XP with mingw:

    setup.py build -c mingw32
    setup.py install --skip-build

    It works fine with English dictionary, but hangs with Russian
    dictionary from Mozilla.
    Ivan Illarionov, Feb 25, 2008
    #5
  6. Dr. leo

    thebjorn Guest

    On Feb 25, 3:56 am, Ivan Illarionov <> wrote:
    > > I don't know if I'm just doing it wrong, or if I can't use extensions
    > > compiled with mingw32 with the standard distribution Python
    > > executable?

    >
    > I was able to install on Windows XP with mingw:
    >
    > setup.py build -c mingw32
    > setup.py install --skip-build
    >
    > It works fine with English dictionary, but hangs with Russian
    > dictionary from Mozilla.


    This is unfortunately deceptive :-( The C-runtime mismatch problem
    happens when memory malloc'd in an extension module is free'd by the
    interpreter (or vice versa). Things might work for a while with this
    mismatch, but will (almost) always crash/hang/etc. in hard to track
    down ways later.

    Using the link that max provided above, I managed to build and install
    without passing any switches and getting no error messages.

    -- bjorn
    thebjorn, Feb 25, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dr. leo
    Replies:
    0
    Views:
    260
    Dr. leo
    Feb 13, 2008
  2. Dr. leo
    Replies:
    0
    Views:
    241
    Dr. leo
    Feb 27, 2008
  3. Dr. leo
    Replies:
    0
    Views:
    249
    Dr. leo
    Mar 2, 2008
  4. Replies:
    0
    Views:
    241
  5. Dr. leo

    Hyphenation: PyHyphen-0.7 released

    Dr. leo, Apr 2, 2008, in forum: Python
    Replies:
    0
    Views:
    269
    Dr. leo
    Apr 2, 2008
Loading...

Share This Page