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

Installation fails on MacOS #24

Open
WilliamVenner opened this issue Jul 27, 2022 · 35 comments · May be fixed by #133
Open

Installation fails on MacOS #24

WilliamVenner opened this issue Jul 27, 2022 · 35 comments · May be fixed by #133

Comments

@WilliamVenner
Copy link

WilliamVenner commented Jul 27, 2022

Python 3.8 was installed by Command Line Tools (Xcode)

dyld[58557]: Library not loaded: @executable_path/../Python3
  Referenced from: /Users/william.venner/Library/Application Support/pypoetry/venv/bin/Python3
  Reason: tried: '/Users/william.venner/Library/Application Support/pypoetry/venv/bin/../Python3' (no such file), '/usr/local/lib/Python3' (no such file), '/usr/lib/Python3' (no such file)

Traceback:

  File "<stdin>", line 892, in main
  File "<stdin>", line 530, in run

Is this a case sensitivity issue?

MacOS Monterey 12.4 on M1 Pro

For anyone stumbling on this

I found installing poetry from homebrew worked fine.

@ifeeltiredboss
Copy link

It's the same for MacOS Monterey 12.3 on Intel. Perhaps some errors in paths?

➜  ~ which python3
/usr/bin/python3

@ifeeltiredboss
Copy link

Installing python with homebrew and then restarting the install script works fine. But I think it shouldn't be necessary to install another python before installing poetry.

@neersighted
Copy link
Member

Looks like macOS's Python is broken. OS-provided Pythons are always touch and go/partially broken, so this is a low priority, but it would be nice to figure out.

@branchvincent
Copy link
Member

branchvincent commented Aug 24, 2022

The issue here is the macOS-provided python is not relocatable, so venv creates a broken python when using --copies / symlinks=False as our installer does. See python/cpython#82886 (comment)

A simple reproduction:

$ /usr/bin/python3 -m venv --copies --without-pip venv && ./venv/bin/python3
dyld[97998]: Library not loaded: '@executable_path/../Python3'
  Referenced from: '/private/tmp/venv/bin/python3'
  Reason: tried: '/private/tmp/venv/bin/../Python3' (no such file), '/usr/local/lib/Python3' (no such file), '/usr/lib/Python3' (no such file)
fish: Job 1, './venv/bin/python3' terminated by signal SIGABRT (Abort)

Perhaps we should try to detect + handle this case and fallback to symlinks=True

@cjolowicz
Copy link

cjolowicz commented Sep 5, 2022

This problem is not limited to Command Line Tools. It applies to any Python on macOS, provided it's built as a framework (--enable-framework). For example, this includes official binaries from python.org and Homebrew. It excludes pyenv which uses the default POSIX build configuration.

From #34 :

The problem appears to be that the installer creates the virtual environment with copies instead of symlinks. This is a good default for Windows, but not for macOS. On macOS, the copied interpreter binary references the Python dynamic library using a path including the full version number. When Homebrew upgrades Python, this path disappears. By contrast, virtual environments created with the default strategy use a symbolic link that remains stable for all releases of a Python feature version (major.minor). Upgrading Python to a maintenance release seamlessly and implicitly upgrades any associated virtual environments.

@cjolowicz
Copy link

cjolowicz commented Sep 5, 2022

Looking a bit further into this, there are some differences between these Pythons. According to the CPython issue linked above, Apple's Python uses a relative path to the dynamic library, which always breaks with symlinks=False. Homebrew uses an absolute path, which breaks when you upgrade to a new release of Python. Official binaries from python.org are probably fine (haven't tested this).

In any case, I'd recommend to use symlinks=True except on Windows. This is also the default that the python -m venv command uses.

@windoverwater
Copy link

windoverwater commented Sep 21, 2022

FYI - on my 2020 M1 mini with the latest MacOS, poetry does not install from scratch. FYI - homebrew is installed for other stuff besides python and miniconda is installed for all things python. I am trying to switch a few projects from conda to poetry.

% which python3
/usr/bin/python3
% ls -l /usr/bin/python3
-rwxr-xr-x 76 root wheel 167120 Aug 24 04:59 /usr/bin/python3*

% python3 install-poetry.py
Retrieving Poetry metadata

Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the poetry command to Poetry's bin directory, located at:

/Users/sandy/.local/bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.2.1): Creating environment
Traceback (most recent call last):
File "/Users/sandy/repos/github.com/install.python-poetry.org/install-poetry.py", line 940, in
sys.exit(main())
File "/Users/sandy/repos/github.com/install.python-poetry.org/install-poetry.py", line 919, in main
return installer.run()
File "/Users/sandy/repos/github.com/install.python-poetry.org/install-poetry.py", line 550, in run
self.install(version)
File "/Users/sandy/repos/github.com/install.python-poetry.org/install-poetry.py", line 571, in install
with self.make_env(version) as env:
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in enter
return next(self.gen)
File "/Users/sandy/repos/github.com/install.python-poetry.org/install-poetry.py", line 643, in make_env
raise e
File "/Users/sandy/repos/github.com/install.python-poetry.org/install-poetry.py", line 629, in make_env
yield VirtualEnvironment.make(env_path)
File "/Users/sandy/repos/github.com/install.python-poetry.org/install-poetry.py", line 309, in make
builder = venv.EnvBuilder(clear=True, with_pip=True, symlinks=False)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/venv/init.py", line 66, in init
self.symlinks = should_use_symlinks(symlinks)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/venv/init.py", line 31, in should_use_symlinks
raise Exception("This build of python cannot create venvs without using symlinks")
Exception: This build of python cannot create venvs without using symlinks

% git logpp -1
* c8c3ce4 - (HEAD -> main, origin/main, origin/HEAD) (34 hours ago) <pre-commit-ci[bot]> [pre-commit.ci] pre-commit autoupdate
% python3 --version
Python 3.9.6

@abhinavdayal
Copy link

python3 -m venv $VENV_PATH
$VENV_PATH/bin/pip install -U pip setuptools
$VENV_PATH/bin/pip install poetry

Using these to install poetry works fine. However this must be repeated for each new project.

@neersighted
Copy link
Member

I'm not sure what you mean @abhinavdayal -- Poetry should not be installed in the project environment. The manual or pipx install directions on https://python-poetry.org/docs work just fine in the mean time.

@jemshit
Copy link

jemshit commented Oct 22, 2022

So pipx is preferred way instead of altering macOS's default python ?

@neersighted
Copy link
Member

It works and many users may prefer it -- however, it's another tool. It would be nice to fix this issue, but it will take a moderate refactor of the installer to do it in a clean way -- no one has put the time in yet.

@cjuracek
Copy link

cjuracek commented Nov 3, 2022

Hi all, just wanted to see if there's a consensus answer for this problem? I'm trying to help someone get Poetry installed and we're hitting this roadblock. We tried to use a Python installed via Pyenv with no luck. Any help appreciated!

@neersighted
Copy link
Member

If you're using a pyenv Python you are hitting something else as pyenv does not set --enable-framework by default. I suggest reaching out on Discussions or Discord for support, or creating a detailed issue report if you've troubleshot things sufficiently and think you're hitting a new bug.

@cjuracek
Copy link

cjuracek commented Nov 3, 2022

@neersighted This may be internal relating to where we're pointing pip to install packages. I'll report back

Update: Problem solved - responsibility 50-50:

  • When using a Pyenv Python: Our bad - it's related to our default pip.conf
  • When using OS Python: Seems to be a script related problem. I'd encourage anyway who encounters this to try out Pyenv (which may fix it). It's a great tool to manage multiple Python verisons.

@neersighted
Copy link
Member

The reason the OS Python fails for you @cjuracek is this issue; --copies does not work with framework (non-relocatable) builds of Python.

@urbanonymous
Copy link

So, just use brew right?

@neersighted
Copy link
Member

neersighted commented Nov 14, 2022

We provide no support for Homebrew installations; feel free to use Homebrew, but please don't open issues against Poetry unless you have reproduced on an install using this script/pipx/pip+venv. pipx and pip+venv work just fine with framework-based Pythons; #79 complicates the fix I had in mind for this issue, and I will need to spend some time reworking it with the new information in mind (or, we may just drop --copies entirely).

@ckabalan
Copy link

Macbook M1 on Ventura with Homebrew-installed Python 3.11. Follow the instructions in @ikebo 's comment for a fix.

I fought with this for like 4 hours over two days, causing me to literally uninstall homebrew, all formulae, and reinstall them all chasing this dyld error. All to no avail, until I found @ralexx 's comment and it worked immediately.

Seems like this should be simple enough to catch the error and re-try with symlink=True if there is not a more suitable solution.

@adrianrfreedman
Copy link

In a conclusion: 1, download the install script, curl -sSL https://install.python-poetry.org > poetry_install.py 2, change the symlink to True on line 317 3, python3 poetry_install.py
that's it

it installed the poetry but the path of poetry is hidden. `~ ❯ python3 poetry_install.py Retrieving Poetry metadata

The latest version (1.5.1) is already installed. ~ ❯ poetry --version zsh: command not found: poetry`

➜  ~ python3 poetry_install.py 
Retrieving Poetry metadata

# Welcome to Poetry!
...
Installing Poetry (1.5.1): Installing Poetry
Installing Poetry (1.5.1): Done

Poetry (1.5.1) is installed now. Great!

To get started you need Poetry's bin directory (/Users/bob/.local/bin) in your `PATH`
environment variable.

Add `export PATH="/Users/bob/.local/bin:$PATH"` to your shell configuration file.

Alternatively, you can call Poetry explicitly with `/Users/bob/.local/bin/poetry`.

You can test that everything is set up by executing:

`poetry --version`

It's important to check the output from the install?
Specifically
Add `export PATH="/Users/bob/.local/bin:$PATH"` to your shell configuration file.`.

Remember, after you add this line, you either need to open a new terminal or run source ~/<your_shell_config_file>.

jfly added a commit to asdf-community/asdf-direnv that referenced this issue Aug 23, 2023
BEfore this diff, it was impossible to install tools that depend on
other tools. For example, here's what happens if I try to install a
version of poetry on my machine:

  $ asdf install poetry 1.5.1
  No version is set for command python3
  Consider adding one of the following versions in your config file at
  python 3.10.2
  python 3.8.10
  curl: (23) Failure writing output to destination

  Cleanup: Something went wrong!

  48 /home/jeremy/.asdf/plugins/poetry/bin/install: POETRY_HOME=$install_path python3 - --version "$version" $flags

This is because my system doesn't actually have a global `python` or
`python3`. While I *could* install python with my system's package
manager, I'd rather re-use my asdf-managed python if at all possible.
Plus, poetry's installer doesn't even work with the 2 most popular ways
of installing python systemwide on macOS (see [this poetry
issue](python-poetry/install.python-poetry.org#24 (comment))
and [this homebrew issue](Homebrew/homebrew-core#138159)).

I know this doesn't solve the general build-dependencies issue: asdf is
not a full package manager and I doubt it ever will become one. I do
think this fairly minor change is worth implementing though, as it will
solve a pain point my team has started running into ever since [homebrew
changed they way they build binaries and that broke poetry
install](Homebrew/homebrew-core#138159).

As a happy side effect, we can now run `direnv reload` for the user,
which saves them a command whenever they need to install missing
dependencies.
jfly added a commit to asdf-community/asdf-direnv that referenced this issue Aug 23, 2023
Before this diff, it was impossible to install tools that depend on
other tools. For example, here's what happens if I try to install a
version of poetry on my machine:

  $ asdf install poetry 1.5.1
  No version is set for command python3
  Consider adding one of the following versions in your config file at
  python 3.10.2
  python 3.8.10
  curl: (23) Failure writing output to destination

  Cleanup: Something went wrong!

  48 /home/jeremy/.asdf/plugins/poetry/bin/install: POETRY_HOME=$install_path python3 - --version "$version" $flags

This is because my system doesn't actually have a global `python` or
`python3`. While I *could* install python with my system's package
manager, I'd rather re-use my asdf-managed python if at all possible.
Plus, poetry's installer doesn't even work with the 2 most popular ways
of installing python systemwide on macOS (see [this poetry
issue](python-poetry/install.python-poetry.org#24 (comment))
and [this homebrew issue](Homebrew/homebrew-core#138159)).

I know this doesn't solve the general build-dependencies issue: asdf is
not a full package manager and I doubt it ever will become one. I do
think this fairly minor change is worth implementing though, as it will
solve a pain point my team has started running into ever since [homebrew
changed they way they build binaries and that broke poetry
install](Homebrew/homebrew-core#138159).

As a happy side effect, we can now run `direnv reload` for the user,
which saves them a command whenever they need to install missing
dependencies.
jfly added a commit to asdf-community/asdf-direnv that referenced this issue Aug 23, 2023
Before this diff, it was impossible to install tools that depend on
other tools. For example, here's what happens if I try to install a
version of poetry on my machine:

    $ asdf install poetry 1.5.1
    No version is set for command python3
    Consider adding one of the following versions in your config file at
    python 3.10.2
    python 3.8.10
    curl: (23) Failure writing output to destination

    Cleanup: Something went wrong!

    48 /home/jeremy/.asdf/plugins/poetry/bin/install: POETRY_HOME=$install_path python3 - --version "$version" $flags

This is because my system doesn't actually have a global `python` or
`python3`. While I *could* install python with my system's package
manager, I'd rather re-use my asdf-managed python if at all possible.
Plus, poetry's installer doesn't even work with the 2 most popular ways
of installing python systemwide on macOS (see [this poetry
issue](python-poetry/install.python-poetry.org#24 (comment))
and [this homebrew issue](Homebrew/homebrew-core#138159)).

I know this doesn't solve the general build-dependencies issue: asdf is
not a full package manager and I doubt it ever will become one. I do
think this fairly minor change is worth implementing though, as it will
solve a pain point my team has started running into ever since [homebrew
changed they way they build binaries and that broke poetry
install](Homebrew/homebrew-core#138159).

As a happy side effect, we can now run `direnv reload` for the user,
which saves them a command whenever they need to install missing
dependencies.
jfly added a commit to asdf-community/asdf-direnv that referenced this issue Aug 23, 2023
Before this diff, it was impossible to install tools that depend on
other tools. For example, here's what happens if I try to install a
version of poetry on my machine:

    $ asdf install poetry 1.5.1
    No version is set for command python3
    Consider adding one of the following versions in your config file at
    python 3.10.2
    python 3.8.10
    curl: (23) Failure writing output to destination

    Cleanup: Something went wrong!

    48 /home/jeremy/.asdf/plugins/poetry/bin/install: POETRY_HOME=$install_path python3 - --version "$version" $flags

This is because my system doesn't actually have a global `python` or
`python3`. While I *could* install python with my system's package
manager, I'd rather re-use my asdf-managed python if at all possible.
Plus, poetry's installer doesn't even work with the 2 most popular ways
of installing python systemwide on macOS (see [this poetry
issue](python-poetry/install.python-poetry.org#24 (comment))
and [this homebrew issue](Homebrew/homebrew-core#138159)).

I know this doesn't solve the general build-dependencies issue: asdf is
not a full package manager and I doubt it ever will become one. I do
think this fairly minor change is worth implementing though, as it will
solve a pain point my team has started running into ever since [homebrew
changed they way they build binaries and that broke poetry
install](Homebrew/homebrew-core#138159).

As a happy side effect, we can now run `direnv reload` for the user,
which saves them a step whenever they need to install missing
dependencies.
jfly added a commit to asdf-community/asdf-direnv that referenced this issue Aug 23, 2023
Before this diff, it was difficult to install tools that depend on
other tools. For example, here's what happens if I try to install a
version of poetry on my machine:

    $ asdf install poetry 1.5.1
    No version is set for command python3
    Consider adding one of the following versions in your config file at
    python 3.10.2
    python 3.8.10
    curl: (23) Failure writing output to destination

    Cleanup: Something went wrong!

    48 /home/jeremy/.asdf/plugins/poetry/bin/install: POETRY_HOME=$install_path python3 - --version "$version" $flags

This is because my system doesn't actually have a global `python` or
`python3`. While I *could* install python with my system's package
manager, I'd rather re-use my asdf-managed python if at all possible.
Plus, poetry's installer doesn't even work with the 2 most popular ways
of installing python systemwide on macOS (see [this poetry
issue](python-poetry/install.python-poetry.org#24 (comment))
and [this homebrew issue](Homebrew/homebrew-core#138159)).

I know this doesn't solve the general build-dependencies issue: asdf is
not a full package manager and I doubt it ever will become one. I do
think this fairly minor change is worth implementing though, as it will
solve a pain point my team has started running into ever since [homebrew
changed they way they build binaries and that broke poetry
install](Homebrew/homebrew-core#138159).

As a happy side effect, we can now run `direnv reload` for the user,
which saves them a step whenever they need to install missing
dependencies.
jfly added a commit to asdf-community/asdf-direnv that referenced this issue Aug 23, 2023
Before this diff, it was difficult to install tools that depend on
other tools. For example, here's what happens if I try to install a
version of poetry on my machine:

    $ asdf install poetry 1.5.1
    No version is set for command python3
    Consider adding one of the following versions in your config file at
    python 3.10.2
    python 3.8.10
    curl: (23) Failure writing output to destination

    Cleanup: Something went wrong!

    48 /home/jeremy/.asdf/plugins/poetry/bin/install: POETRY_HOME=$install_path python3 - --version "$version" $flags

This is because my system doesn't actually have a global `python` or
`python3`. While I *could* install python with my system's package
manager, I'd rather re-use my asdf-managed python if at all possible.
Plus, poetry's installer doesn't even work with the 2 most popular ways
of installing python systemwide on macOS (see [this poetry
issue](python-poetry/install.python-poetry.org#24 (comment))
and [this homebrew issue](Homebrew/homebrew-core#138159)).

I know this doesn't solve the general build-dependencies issue: asdf is
not a full package manager and I doubt it ever will become one. I do
think this fairly minor change is worth implementing though, as it will
solve a pain point my team has started running into ever since [homebrew
changed they way they build binaries, which broke poetry
install](Homebrew/homebrew-core#138159).

As a happy side effect, we can now run `direnv reload` for the user,
which saves them a step whenever they need to install missing
dependencies.
jfly added a commit to asdf-community/asdf-direnv that referenced this issue Aug 23, 2023
Before this diff, it was difficult to install tools that depend on
other tools. For example, here's what happens if I try to install a
version of poetry on my machine:

    $ asdf install poetry 1.5.1
    No version is set for command python3
    Consider adding one of the following versions in your config file at
    python 3.10.2
    python 3.8.10
    curl: (23) Failure writing output to destination

    Cleanup: Something went wrong!

    48 /home/jeremy/.asdf/plugins/poetry/bin/install: POETRY_HOME=$install_path python3 - --version "$version" $flags

This is because my system doesn't actually have a global `python` or
`python3`. While I *could* install python with my system's package
manager, I'd rather re-use my asdf-managed python if at all possible.
Plus, poetry's installer doesn't even work with the 2 most popular ways
of installing python systemwide on macOS (see [this poetry
issue](python-poetry/install.python-poetry.org#24 (comment))
and [this homebrew issue](Homebrew/homebrew-core#138159)).

I know this doesn't solve the general build-dependencies issue: asdf is
not a full package manager and I doubt it ever will become one. I do
think this fairly minor change is worth implementing though, as it will
solve a pain point my team has started running into ever since [homebrew
changed they way they build binaries, which broke poetry
install](Homebrew/homebrew-core#138159).

As a happy side effect, we can now run `direnv reload` for the user,
which saves them a step whenever they need to install missing
dependencies.
@vincer
Copy link

vincer commented Aug 24, 2023

A one-liner of @ikebo 's solution:

curl -sSL https://install.python-poetry.org | sed 's/symlinks=False/symlinks=True/' | python3 -

@ethanmsl
Copy link

ethanmsl commented Sep 1, 2023

Just to add some context, in case it impacts prioritization or maintainer interest:
these issues make it much more difficult to get other workplace devs to use Poetry. Already an uphill battle. Macs being common as the type of computer companies give to employees (at least in my area).

@iftekhariasif
Copy link

I am getting the following error =>
My Python version is => Python 3.11.5
I ran the command => curl -sSL https://install.python-poetry.org | python3 -
Can anyone help?

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/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.11/lib/python3.11/http/client.py", line 1286, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1332, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1281, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1041, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 979, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1458, in connect
    self.sock = self._context.wrap_socket(self.sock,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 517, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1108, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1379, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 945, in <module>
  File "<stdin>", line 923, in main
  File "<stdin>", line 524, in run
  File "<stdin>", line 786, in get_version
  File "<stdin>", line 847, in _get
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 519, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/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:1006)>

@Kevin-free
Copy link

Kevin-free commented Sep 9, 2023

A one-liner of @ikebo 's solution:

curl -sSL https://install.python-poetry.org | sed 's/symlinks=False/symlinks=True/' | python3 -

Thanks!
I have been stuck at Installing Poetry (1.6.1): Installing Poetry. After waiting for a long time, there is no progress. The network is normal. How to troubleshoot and solve it?

Mac OS 12.6.3

@ethanmsl
Copy link

ethanmsl commented Sep 9, 2023

I ran the command => curl -sSL https://install.python-poetry.org | python3 - Can anyone help?

@iftekhariasif : see the post two comments before yours - using sed to switch symlink setting

@luceat-lux-vestra
Copy link

I think it should be fixed.
homebrew way is just an alternative way.

@PabloLION
Copy link

I tried the script is still not working, and nor is the brew version. But somehow pip3 install poetry works and I can have access to poetry directly in zshell terminal.

@C-alcium
Copy link

I agree with @ethanmsl - The first command you execute related to this project failing with such an uninformative error message is quite discouraging for newcomers. Maybe just as a short term fix on the homepage @vincer's one liner can be placed there for macos / apple silicone users. Ideally though there should be some way to handle this in the script.

jfly added a commit to asdf-community/asdf-direnv that referenced this issue Nov 20, 2023
Before this diff, it was difficult to install tools that depend on
other tools. For example, here's what happens if I try to install a
version of poetry on my machine:

    $ asdf install poetry 1.5.1
    No version is set for command python3
    Consider adding one of the following versions in your config file at
    python 3.10.2
    python 3.8.10
    curl: (23) Failure writing output to destination

    Cleanup: Something went wrong!

    48 /home/jeremy/.asdf/plugins/poetry/bin/install: POETRY_HOME=$install_path python3 - --version "$version" $flags

This is because my system doesn't actually have a global `python` or
`python3`. While I *could* install python with my system's package
manager, I'd rather re-use my asdf-managed python if at all possible.
Plus, poetry's installer doesn't even work with the 2 most popular ways
of installing python systemwide on macOS (see [this poetry
issue](python-poetry/install.python-poetry.org#24 (comment))
and [this homebrew issue](Homebrew/homebrew-core#138159)).

I know this doesn't solve the general build-dependencies issue: asdf is
not a full package manager and I doubt it ever will become one. I do
think this fairly minor change is worth implementing though, as it will
solve a pain point my team has started running into ever since [homebrew
changed they way they build binaries, which broke poetry
install](Homebrew/homebrew-core#138159).

As a happy side effect, we can now run `direnv reload` for the user,
which saves them a step whenever they need to install missing
dependencies.
@discay
Copy link

discay commented Feb 26, 2024

python3 -m venv $VENV_PATH $VENV_PATH/bin/pip install -U pip setuptools $VENV_PATH/bin/pip install poetry

Using these to install poetry works fine. However this must be repeated for each new project.

Nice !! worked for me

@CarstVaartjes
Copy link

I used Conda to create a 3.11 venv on my M2 mac and then installed poetry without issues there

@ajagatobby
Copy link

A one-liner of @ikebo 's solution:

curl -sSL https://install.python-poetry.org | sed 's/symlinks=False/symlinks=True/' | python3 -

The solution is correct ✅

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