sms-tools icon indicating copy to clipboard operation
sms-tools copied to clipboard

module 'utilFunctions_C' has no attribute 'twm'

Open roviso opened this issue 5 years ago • 3 comments

While running the F0 detection function and harmonicModel, i encountered this AttributeErrorvon the utilFunctions_c module. Any help would be appriciated.. :)

roviso avatar Mar 31 '21 09:03 roviso

Hi @roviso,

I just had this problem, and compiling the C functions fixed the problem for me.

From the readme:

After downloading the whole package, you need to compile some C functions. For that you should go to the directory software/models/utilFunctions_C and type:

$ python compileModule.py build_ext --inplace

I have used sms-tools successfully on this computer in the past (~1 year ago), but I think updates to my linux version and perhaps other things broke something. But yeah, running that command fixed my problem (the exact same error you had).

Hope that helps!

Jetroid avatar Apr 28 '21 22:04 Jetroid

ISSUE: While using a GUI, say, performing Analysis/Synthesis, instead than showing a Diagram they produce this error message in the command line: "module 'utilFunctions_C' has no attribute 'twm' "

OS: Windows 10

INTRO: As for the Readme.md, you have to build some C file. However, when doing this, you may still experience a "fatal error: cannot open input file 'm.lib' "

A web search resulted in the following suggestion: "replacing 'm' with 'msvcrt' solved the issue." (source: https://stackoverflow.com/questions/36121570/error-1181-cannot-open-input-file-m-lib-with-python-3-5-1 )

SOLUTION: Edit the file compileModule.py and change: libraries=['m'] with libraries=['msvcrt']

Now perform the build again and you should see a new .py file, and the GUI functions will now work fine.

SIDE COMMENTS: If you keep having troubles with Python modules and C compiling first of all, also try these:

  • check for Python folders "Scripts" and "site-packages" to be into AppData/Roaming/PythonXX (recent versions) or into C:\PythonXX folder (older versions), in order to have a consistent Path variable
  • update Microsoft Visual Studio with C++ modules to the most recent version (and restart)

Best luck

siberia3 avatar Sep 15 '21 21:09 siberia3