question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to install Poetry on macOS Catalina for Python3

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: macOS 10.15.7
  • Poetry version: 0.14
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

I’m trying to install Poetry using the download script get-poetry.py with the official Python 3.9.1 downloaded from python.org. But failed with the following errors.

$ python3 get-poetry.py 
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1342, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 950, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1424, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/me/Desktop/_dev/get-poetry.py", line 1086, in <module>
    sys.exit(main())
  File "/Users/me/Desktop/_dev/get-poetry.py", line 1060, in main
    urlopen(Installer.REPOSITORY_URL)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 517, in open
    response = self._open(req, data)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 534, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1385, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1345, 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:1123)>

Using the system builtin Python2.7, I got no such errors. But since py27 is deprecated for Poetry. I got no choice but to use Python3.

If I’m the only one with this problem, then it must be my own setup, but what am I missing?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pemistahlcommented, Jul 13, 2021

Navigating to Application/Python 3.9 folder, you will see the command file shipped with Python: Install Certificates.command. Run that command

I had the same problem like the author. Executing the command above solved it for me and I could install poetry using Python 3.9.

1reaction
kottncommented, Jan 19, 2021

@sanders41 Thanks a lot. I solved. The problem was Proxy settings as you said.

Read more comments on GitHub >

github_iconTop Results From Across the Web

poetry installation failing on Mac OS, says ... - Stack Overflow
I am trying to install poetry using the following command curl -sSL https://install.python-poetry.org | python3 -. but it is failing with ...
Read more >
poetry - PyPI
Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right stack everywhere. Poetry Install. Poetry replaces ...
Read more >
I can't install TensorFlow-macos a… | Apple Developer Forums
I am on Monterey release now and System python3 is 3.7: which python3 -> /usr/bin/python3 ; python3 --version -> Python 3.7.3 . Installing...
Read more >
Introduction | master | Documentation | Poetry - Python ...
Any installs performed using get-poetry.py should be uninstalled and reinstalled using install.python-poetry.org to ensure in-place upgrades are possible.
Read more >
poetry install fails with [CalledProcessError] while installing ...
I'm new to python and github. when I'm trying to install few submodules getting below error. I'm using git bash on windows; pip...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found