Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install the library #10

Closed
Svito-zar opened this issue Jan 16, 2019 · 29 comments
Closed

Can't install the library #10

Svito-zar opened this issue Jan 16, 2019 · 29 comments

Comments

@Svito-zar
Copy link

I am using Linux OS (Ubuntu 16.04) and Python version 3.5.

I have just installed the library (on my Anaconda virtenv) and I am getting an error when trying to import it:

import parselmouth

"Traceback (most recent call last):
File "", line 1, in
File "/home/taras/anaconda3/envs/CondaEnvPy3Tf/lib/python3.5/site-packages/parselmouth/init.py", line 22, in
from parselmouth.base import Parselmouth
File "/home/taras/anaconda3/envs/CondaEnvPy3Tf/lib/python3.5/site-packages/parselmouth/base.py", line 30, in
from parselmouth.adapters.dfp.interface import DFPInterface
File "/home/taras/anaconda3/envs/CondaEnvPy3Tf/lib/python3.5/site-packages/parselmouth/adapters/dfp/interface.py", line 17, in
from urllib import quote
ImportError: cannot import name 'quote' "

@YannickJadoul
Copy link
Owner

@Svito-zar I believe you might have pip installed the parselmouth package, instead of praat-parselmouth? Unfortunately the previous name was already taken on the Python Package Index, so the package name vs. project name is slightly confusing. Apologies for that, but nothing I can do anything about, as far as know :-(

Can you confirm whether this is the case, or whether something else is wrong?

@Svito-zar
Copy link
Author

Yes, that indeed was an issue

@YannickJadoul
Copy link
Owner

OK, I'll close this issue, then, if it is indeed resolved.

@jyothika12
Copy link

hi i am also having the same issue .. i have pip installed praat parselmouth only but still.
ImportError: cannot import name 'quote' from 'urllib' (C:\Users\Jyotika Patwardhan\AppData\Local\Programs\Python\Python37-32\lib\urllib_init_.py)

@YannickJadoul
Copy link
Owner

YannickJadoul commented Jun 20, 2019

@jyothika12 Is it the same problem? Have you pip installed parselmouth instead of praat-parselmouth? (cfr. https://parselmouth.readthedocs.io/en/stable/installation.html)

Then the same solution from above should also work, I hope?

EDIT: Sorry, I had not read that you did install praat-parselmouth, afterwards. Have you ran pip uninstall parselmouth, then, as well, to remove the other project?

@jyothika12
Copy link

jyothika12 commented Jun 21, 2019 via email

@YannickJadoul
Copy link
Owner

@jyothika12 Hmmm, weird. Two things:

  • Can you run pip uninstall parselmouth and see what happens?
  • If that doesn't help: could you copy-paste the full traceback of the error you're getting, instead of just the last line? Then we see where the error originates.

@jyothika12
Copy link

jyothika12 commented Jun 22, 2019 via email

@jyothika12
Copy link

jyothika12 commented Jun 22, 2019 via email

@jyothika12
Copy link

jyothika12 commented Jun 22, 2019 via email

@YannickJadoul
Copy link
Owner

@jyothika12 We're already making progress, then, if it doesn't have the other issue anymore :-)

I think this problem occurs because of multiple versions of Python you have installed, where one is 32-bit and the other is 64-bit. I checked the versions of Parselmouth, and as far as I can see, these are correctly 32 and 64-bit. So my current guess is that your pip somehow installs a 32-bit version of Parselmouth into the directory that contains libraries for your 64-bit version.

Relevant StackOverflow answers, I found:
https://stackoverflow.com/questions/19019720/importerror-dll-load-failed-1-is-not-a-valid-win32-application-but-the-dlls
https://stackoverflow.com/questions/43434028/how-to-pip-install-64-bit-packages-while-having-both-64-bit-and-32-bit-versions

Could you, please:

  • Report the output of running pip --version and where python in the terminal?
  • Report the output you get when starting Python, both in the terminal as well as in PyCharm? I mean the lines that look something like this, and tell me whether it's 32-bit or 64-bit:
    Python 3.6.8 (default, Jan 14 2019, 11:02:34) 
    [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    
  • Report the output of running python -m site and C:\Users\Jyotika Patwardhan\PycharmProjects\Demo_1\venv\Scripts\python.exe -m sit in your terminal.

Sorry for all these questions and that I don't have an answer yet, but I need to get this info to see what's going wrong. I hope that once I have this information about the different Python versions on your computer, I can confirm that nothing's wrong with Parselmouth, and give you the command to get the installation fixed :-)

@jyothika12
Copy link

jyothika12 commented Jun 24, 2019 via email

@jyothika12
Copy link

jyothika12 commented Jun 24, 2019 via email

@YannickJadoul
Copy link
Owner

@jyothika12 Right, so there are indeed (at least) two Python versions, one saying '64 bit (AMD64)', while the other says '32 bit (Intel)' :-) Thank you very much for confirming that!

I would suggest uninstalling Parselmouth one last time. Then go into the Python interpreter shell where you want to use Parselmouth, and run:

>>> import subprocess, sys
>>> subprocess.call([sys.executable, "-m", "pip", "install", "-U", "--force-reinstall", "praat-parselmouth"])
...

(You can also see https://parselmouth.readthedocs.io/en/stable/installation.html#multiple-python-versions for more details, or other ways of fixing multiple installed Python versions :-) )

@YannickJadoul
Copy link
Owner

(If this doesn't work, do let me know; but I think this should do the trick, using sys.executable to get the right version of Python and pip)

@jyothika12
Copy link

jyothika12 commented Jun 24, 2019 via email

@YannickJadoul
Copy link
Owner

@jyothika12 Are you running this in the "Python Console" of PyCharm, and not in the "Terminal"?
The lines I sent must be executed inside of Python.

@jyothika12
Copy link

jyothika12 commented Jun 24, 2019 via email

@YannickJadoul
Copy link
Owner

YannickJadoul commented Jun 24, 2019

I am running this inside pycharm terminal

@jyothika12 Then either run in the in the PyCharm Python console, or run python first inside the PyCharm Terminal

@jyothika12
Copy link

jyothika12 commented Jun 24, 2019 via email

@jyothika12
Copy link

jyothika12 commented Jun 24, 2019 via email

@jyothika12
Copy link

jyothika12 commented Jun 24, 2019 via email

@YannickJadoul
Copy link
Owner

@jyothika12 So it has not worked? :-(
Sorry; I will try this out on a Windows machine I have access to, now, and see if I can get the same error :-/

@jyothika12
Copy link

jyothika12 commented Jun 24, 2019 via email

@YannickJadoul
Copy link
Owner

Let's continue the discussion in the new #18 issue?

@Fallarcomigo
Copy link

Hi there,

I'm new to praat, however, initiated the installation of parselmouth in anaconda3 python. And found out that module Praat doesnt exist in the parselmouth package to use the call function. can someone help please.

im getting an era below when i perform (from parselmouth.Praat import call)

ModuleNotFoundError: No module named 'parselmouth.Praat'; 'parselmouth' is not a package

@YannickJadoul
Copy link
Owner

@Fallarcomigo This seems like another issue than the original issue, so it is maybe better to start another thread (or quickly ask on Gitter).

I think the problem is the capital in what you write. It's from parselmouth.praat import call, not Praat.
If you did that correctly, then can you say whether you can import parselmouth and print(parselmouth.Sound). Does that give errors, and which ones?

@Fallarcomigo
Copy link

thank you so much.that was the problem, it works well now.

@YannickJadoul
Copy link
Owner

Great! Thanks for letting me know, @Fallarcomigo :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants