Parselmouth icon indicating copy to clipboard operation
Parselmouth copied to clipboard

Missing import praat

Open Guillaume-Risch opened this issue 2 years ago • 5 comments

Hello, I have a problem with the using of praat I tried this : from parselmouth.praat import call, run_file But I met this error Import "parselmouth.praat" could not be resolved(reportMissingImports) By the way I had installed parselmouth with pip install praat-parselmouth Have you any ideas to help me ?

Thank you!

Guillaume-Risch avatar May 18 '22 07:05 Guillaume-Risch

Hi, @Guillaume-Risch. That's really weird indeed. There's a few things I can think of to try:

  • Could you import parselmouth and print(parselmouth.__file__) and report the output?
  • And could you print(dir(parselmouth))?
  • What happens if you first import parselmouth, and then run from parselmouth.praat import call? (It should work, though, the way you did it; just trying to debug)

Moreover, just to be complete, what version of Python are you running, and on which OS?

YannickJadoul avatar May 19 '22 02:05 YannickJadoul

Hi, @Guillaume-Risch. That's really weird indeed. There's a few things I can think of to try:

  • Could you import parselmouth and print(parselmouth.__file__) and report the output?
  • And could you print(dir(parselmouth))?
  • What happens if you first import parselmouth, and then run from parselmouth.praat import call? (It should work, though, the way you did it; just trying to debug)

Moreover, just to be complete, what version of Python are you running, and on which OS?

I'm facing the same issue, the error in from parselmouth.praat import call, run_file keep showing, tried pip uninstall, install and even the sys subprocess method you suggested in another issue!

here are the details you requested!

image

Boombabyyyyy avatar Aug 09 '22 18:08 Boombabyyyyy

any updates? 🥺 @YannickJadoul

Boombabyyyyy avatar Aug 11 '22 07:08 Boombabyyyyy

@Boombabyyyyy, I was holiday for a week. So better give me a bit more time than half a day to reply ;-)

Apart from that, I don't see the issue? In your terminal, Parselmouth is correctly installed, so it seems to just be VSCode which is not processing the library correctly?

What happens if you just run the script? Ignore the yellow underline.

YannickJadoul avatar Aug 17 '22 20:08 YannickJadoul

@Boombabyyyyy, please double-check your VSCode setup (e.g. look at https://linuxpip.org/fix-python-unresolved-import-in-vscode/) and see if things get resolved that way. Based on your output, Parselmouth is correctly installed, and can be imported and run. The only thing I can think of is that VSCode is confused because of Parselmouth being a binary extension module for Python, but ... yeah, not much I can do there.

YannickJadoul avatar Aug 17 '22 20:08 YannickJadoul

Closing, after almost a year without reply.

YannickJadoul avatar Feb 24 '23 10:02 YannickJadoul