Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8820975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:44:25+00:00 2026-06-14T05:44:25+00:00

I have a need to make use of Chromium’s Compact Language Detector library within

  • 0

I have a need to make use of Chromium’s Compact Language Detector library within a Python script.

AFAIK, there are two projects that leverage this library, but I have been having troubles with getting either of them set up on a Windows 7 machine.

I had some similar problems with Mike McCandless Original Project (GoogleCode), but I then spotted Matt Sanford fork on the same Project (github). For the purpose of this question, I will focus on Matts project, as it seems to have been updated more often (but happy to get an answer that works for either project).

  • Downloaded the project as a zip, and extracted to my local drive.
  • Ran vcvarsall.bat from CMD
  • Then ran the build.win.cmd batch file. This ran ok.
  • Copied the resulting libcld.lib to ports/python/cld.lib
  • Tried running the setup.py but it returns with the following against line 12.

    exceptions.TypeError: init() keywords must be strings

++EDIT++
Found this issue:

setup.py fails on Windows. The hackish solution to fix this is to make
pkgconfig return the dict {‘define_macros’: [(‘WIN32’,None)],
‘libraries’: packages}

Im a bit of a rookie, but not entirely sure on the steps to implement this hack. Can anyone give me some slightly more verbose steps?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:44:27+00:00Added an answer on June 14, 2026 at 5:44 am

    Try this patch (works for me):

    diff --git a/ports/python/setup.py b/ports/python/setup.py
    index e1950c3..889f21a 100644
    --- a/ports/python/setup.py
    +++ b/ports/python/setup.py
    @@ -9,7 +9,10 @@ def pkgconfig(*packages, **kw):
    
     module = Extension('cld',
                        ['pycldmodule.cc'],
    -                   **pkgconfig('cld'))
    +                   define_macros=[('WIN32', None)],
    +                   libraries=['libcld'], 
    +                   include_dirs=['..\\..\\'],
    +                   library_dirs=['..\\..\\'])
    
     setup(name='cld',
           version='0.031415',
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to make use of some OWL ontologies in c#. Does anyone have
I need to make a series (1-20) ajax calls and I need to have
I need to make the program which have one form that contains PNG image
I have several entities I need to make IEquatable(Of TEntity) respectively. I want them
I have this unsafe code that I need to make safe so it can
I have a processes where I need to make ~100 http api calls to
I have an excel file that I need to make some changes. I need
I have some data which i need to make some statistics. I need to
I need to make a cURL request to a https URL, but I have
I have this code and I need to make this work: if ($handle =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.