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

SSL Error when installing crepe #95

Open
ManishJu opened this issue Mar 25, 2023 · 13 comments
Open

SSL Error when installing crepe #95

ManishJu opened this issue Mar 25, 2023 · 13 comments

Comments

@ManishJu
Copy link

 × 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
Copy link

I also met this error

@yzchen563
Copy link

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

@yawjalik
Copy link

@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
Copy link

yzchen563 commented Sep 21, 2023 via email

@yawjalik
Copy link

@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
Copy link

yzchen563 commented Sep 21, 2023 via email

@yzchen563
Copy link

yzchen563 commented Sep 21, 2023 via email

@yawjalik
Copy link

I just did a regular pip3 install crepe

@yzchen563
Copy link

yzchen563 commented Sep 21, 2023 via email

@yawjalik
Copy link

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
Copy link

yzchen563 commented Sep 21, 2023 via email

@dbetchkal
Copy link

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
Copy link

debashisbiswas commented Sep 29, 2023

@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

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

6 participants