Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Trouble during installation - cannot import nam "quote" from "urlib"

143 views
Skip to first unread message

Invernizzi Sandra

unread,
Jul 9, 2023, 4:09:47 AM7/9/23
to Parselmouth
Hello there,

First, thank you for sharing such a wonderfull tool.

I'm just starting and I have some trouble for the installation of the library.

I'm using the interface pycharm ;

the first step went well : with the command pip install praat-parselmouth in the terminal, the library was successfully installed

But when I use the "import parselmouth" command in the script, something goes wrong; the error message says "ImportError: cannot import name 'quote' from 'urllib'".

Is it a usual problem ? Can you help me fix it ?

Thank you so much

Sandra


yannick...@gmail.com

unread,
Jul 9, 2023, 4:53:08 PM7/9/23
to Parselmouth
Hi Sandra

Could it be that you `pip install`ed the "parselmouth" package, rather than "praat-parselmouth"? The package to install is (unfortunately) called "praat-parselmouth" (see https://pypi.org/project/praat-parselmouth/), whereas the module you install will still be "parselmouth". See also https://parselmouth.readthedocs.io/en/stable/installation.html.

Alternatively, "parselmouth" was maybe already installed, so you might want to remove it with `pip uninstall parselmouth`.

If this is not the case, please get back to me! I'm just guessing here, cause normally the wrong installation is what causes this error, but if you say you did install "praat-parselmouth", maybe it's something else.

Kind regards
Yannick

Invernizzi Sandra

unread,
Jul 10, 2023, 3:41:36 AM7/10/23
to Parselmouth
Dear Yannick,

I uninstall parselmouth and install parselmouth-praat through the pip function in the terminal.

However, when I try the basic code proposed as a first step on the website (https://parselmouth.readthedocs.io/en/stable/examples/plotting.html), the wheling of the script is immediately interrupted with this error-message :

Traceback (most recent call last):
  File "C:\Users\535607\PycharmProjects\pythonProject2\extraction_temps.py", line 1, in <module>
    import parselmouth
  File "C:\Users\535607\OneDrive - UMONS\Pythonworkingdirectory\PsychoPy\lib\site-packages\parselmouth\__init__.py", line 22, in <module>
    from parselmouth.base import Parselmouth
  File "C:\Users\535607\OneDrive - UMONS\Pythonworkingdirectory\PsychoPy\lib\site-packages\parselmouth\base.py", line 30, in <module>
    from parselmouth.adapters.dfp.interface import DFPInterface
  File "C:\Users\535607\OneDrive - UMONS\Pythonworkingdirectory\PsychoPy\lib\site-packages\parselmouth\adapters\dfp\interface.py", line 17, in <module>
    from urllib import quote
ImportError: cannot import name 'quote' from 'urllib' (C:\Users\535607\OneDrive - UMONS\Pythonworkingdirectory\PsychoPy\lib\urllib\__init__.py)

Maybe someone else already encounter this error-message ?

thank you so much for your precious time

Sandra

yannick...@gmail.com

unread,
Jul 10, 2023, 10:12:14 AM7/10/23
to Parselmouth
Dear Sandra

Based on this full error message, I am reasonably sure that there is still a version of the wrong "parselmouth" package installed in this environment.

You should be able to go to the "C:\Users\535607\OneDrive - UMONS\Pythonworkingdirectory\PsychoPy\lib\site-packages\" folder and delete the "parselmouth" and "parselmouth-x.y.z-dist-info" folders in there. That's uninstalling without using pip, and you're sure it's in the right directory.

Or just create a new environment in PyCharm and delete the old one!


Let me know if this helps! If not, happy to help some other way.

Kind regards
Yannick

Invernizzi Sandra

unread,
Jul 10, 2023, 10:43:56 AM7/10/23
to Parselmouth
Dear Yannick,

I did put some order between all the files and uninstall (and re-install) Pycharm in a clean environment.

Now I can open Parselmouth :-) Thank you so much for your support !

Sandra

yannick...@gmail.com

unread,
Jul 10, 2023, 10:46:13 AM7/10/23
to Parselmouth
Amazing! Good to hear; thanks for letting me know! :-)

Good luck, and don't hesitate to ask any further questions if you encounter more issues!
Yannick
Reply all
Reply to author
Forward
0 new messages