marl / crepe

CREPE: A Convolutional REpresentation for Pitch Estimation -- pre-trained model (ICASSP 2018)
https://marl.github.io/crepe/
MIT License
1.11k stars 158 forks source link

SSL Error when installing crepe #95

Open ManishJu opened 1 year ago

ManishJu commented 1 year ago
 × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      /private/var/folders/56/8h0vhww154703m1qmty5j0xm0000gp/T/pip-req-build-xj9rjy7a/setup.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
        import imp
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open
          h.request(req.get_method(), req.selector, req.data, headers,
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1282, in request
          self._send_request(method, url, body, headers, encode_chunked)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1328, in _send_request
          self.endheaders(body, encode_chunked=encode_chunked)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1277, in endheaders
          self._send_output(message_body, encode_chunked=encode_chunked)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1037, in _send_output
          self.send(msg)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 975, in send
          self.connect()
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1454, in connect
          self.sock = self._context.wrap_socket(self.sock,
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
          return self.sslsocket_class._create(
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
          self.do_handshake()
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake
          self._sslobj.do_handshake()
      ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/56/8h0vhww154703m1qmty5j0xm0000gp/T/pip-req-build-xj9rjy7a/setup.py", line 30, in <module>
          urlretrieve(base_url + compressed_file, compressed_path)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 241, in urlretrieve
          with contextlib.closing(urlopen(url, data)) as fp:
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
          return opener.open(url, data, timeout)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
          response = self._open(req, data)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
          result = self._call_chain(self.handle_open, protocol, protocol +
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
          result = func(*args)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
          return self.do_open(http.client.HTTPSConnection, req,
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
          raise URLError(err)
      urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
      Downloading weight file model-tiny.h5.bz2 ...
      [end of output]
RuinianChen commented 1 year ago

I also met this error

yzchen563 commented 1 year ago

I meet the same error. Do you have some ways to solve the problem? @RuinianChen @ManishJu

yawjalik commented 1 year ago

@yzchen563 Did you by any chance attempt to install crepe on MacOS? I reinstalled python on my machine and there were no more issues.

yzchen563 commented 1 year ago

Thanks for your attention! I meet this problem on MACOS actually.  But in my opinion, it's not the OS related problem. If i remembered the analysis in that time rightly, the root issue is the missing pre-trained crepe models, whose URLs are fixed in installed package. These models had been on a github repository, but it wasn't there already.  You can try to validate that by adding a line url printing code in the position just before reporting the network related error. Am i right?

---Original--- From: "Jalik @.> Date: Thu, Sep 21, 2023 19:00 PM To: @.>; Cc: @.**@.>; Subject: Re: [marl/crepe] SSL Error when installing crepe (Issue #95)

@yzchen563 Did you by any chance attempt to install crepe on MacOS? I reinstalled python on my machine and there were no more issues.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

yawjalik commented 1 year ago

@yzchen563 Yes, it's not an issue with the OS, but somehow some ssl certificate configs are kind of weird when installing python on mac. You may have a look at this post.

But I also realized that my python installations are all over the place (some in /opt/homebrew/bin, others in /Applications/Python 3.x) so I just decided to do a clean installation using homebrew. Everything works fine now, no missing pre-trained models...

yzchen563 commented 1 year ago

It's amazing, I am using miniconda. I will try your solution. Ok or not, i will answer you soon.

---Original--- From: "Jalik @.> Date: Thu, Sep 21, 2023 19:24 PM To: @.>; Cc: @.**@.>; Subject: Re: [marl/crepe] SSL Error when installing crepe (Issue #95)

@yzchen563 Yes, it's not an issue with the OS, but somehow some ssl certificate configs are kind of weird when installing python on mac. You may have a look at this post.

But I also realized that my python installations are all over the place (some in /opt/homebrew/bin, others in /Applications/Python 3.x) so I just decided to do a clean installation using homebrew. Everything works fine now, no missing pre-trained models...

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

yzchen563 commented 1 year ago

Sorry, my apologies. The command or parameters used to install "crepe" cannot be found in my brew search. Could you please let me know what command or parameters you used to install it?

---Original--- From: "Jalik @.> Date: Thu, Sep 21, 2023 19:24 PM To: @.>; Cc: @.**@.>; Subject: Re: [marl/crepe] SSL Error when installing crepe (Issue #95)

@yzchen563 Yes, it's not an issue with the OS, but somehow some ssl certificate configs are kind of weird when installing python on mac. You may have a look at this post.

But I also realized that my python installations are all over the place (some in /opt/homebrew/bin, others in /Applications/Python 3.x) so I just decided to do a clean installation using homebrew. Everything works fine now, no missing pre-trained models...

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

yawjalik commented 1 year ago

I just did a regular pip3 install crepe

yzchen563 commented 1 year ago

Still URLRrror:

urllib.error.URLError: <urlopen error [Errno 61] Connection refused>     Downloading weight file model-tiny.h5.bz2 ...

---Original--- From: "Jalik @.> Date: Thu, Sep 21, 2023 19:54 PM To: @.>; Cc: @.**@.>; Subject: Re: [marl/crepe] SSL Error when installing crepe (Issue #95)

I just did a regular pip3 install crepe

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

yawjalik commented 1 year ago

Oh dear.. did you attempt to reinstall python on your machine though? If you haven't and are okay with it, then you may try this guide.

I used vscode to check for all existing python versions that are installed on my machine, uninstalled most of them and reinstalled using homebrew. I also used venv to create my virtual environment when pip installing crepe. Hopefully that will work 🤞

yzchen563 commented 1 year ago

​In setup.py file of repository https://github.com/marl/crepe

Can you access this address? base_url​ ​=​ ​'https://github.com/marl/crepe/raw/models/'

---Original--- From: "Jalik @.> Date: Thu, Sep 21, 2023 19:54 PM To: @.>; Cc: @.**@.>; Subject: Re: [marl/crepe] SSL Error when installing crepe (Issue #95)

I just did a regular pip3 install crepe

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

dbetchkal commented 1 year ago

Not sure if this will be helpful, but my employer uses SSL encryption, and so every time I use pip I have to deliberately include the path to our certificate to avoid these types of errors: pip install crepe --cert="T:\Path\To\Certificate\OurRootCA.cer"

debashisbiswas commented 1 year ago

@yzchen563

Can you access this address? base_url​ ​=​ ​'https://github.com/marl/crepe/raw/models/'

The URL doesn't seem to be the problem. There's nothing at the base URL, but you should be able to access https://github.com/marl/crepe/raw/models/model-tiny.h5.bz2, https://github.com/marl/crepe/raw/models/model-small.h5.bz2, etc

From what I can tell, this looks like a certificate-related issue on MacOS related to how Python is installed