简体   繁体   中英

poetry install fails on macOS 11.6/Xcode 13: dyld: Library not loaded: @executable_path/../Python3

New poetry install fails on macOS 11.6/Xcode 13, using official installer:

u@s-MacBook-Pro ~ % curl -sSL https://install.python-poetry.org | python3 -
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/u/Library/Python/3.8/bin

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

Installing Poetry (1.1.12): An error occurred. Removing partial environment.
Poetry installation failed.
See /Users/u/poetry-installer-error-h3v75uw9.log for error logs.
u@s-MacBook-Pro ~ % more /Users/u/poetry-installer-error-h3v75uw9.log
dyld: Library not loaded: @executable_path/../Python3
  Referenced from: /Users/u/Library/Application Support/pypoetry/venv/bin/python3
  Reason: image not found

Traceback:

  File "<stdin>", line 877, in main
  File "<stdin>", line 514, in run
u@s-MacBook-Pro ~ % 

There is no previous poetry install or reference to poetry in caches or Application Support:

u@s-MacBook-Pro ~ % ls -al Library/Application\ Support/pypoetry
total 0
drwxr-xr-x   2 u  staff    64 26 Jan 16:58 .
drwx------+ 55 u  staff  1760 26 Jan 16:43 ..
u@s-MacBook-Pro ~ % ls -al Library/Caches/pypoetry
ls: Library/Caches/pypoetry: No such file or directory

Python version 3.8.9:

u@s-MacBook-Pro ~ % python3 --version
Python 3.8.9
u@s-MacBook-Pro ~ %

Xcode version:

u@s-MacBook-Pro ~ % xcodebuild -version
Xcode 13.2.1
Build version 13C100
u@s-MacBook-Pro ~ %

I worked through this by installing a non-system version of python3, then installing poetry.

  1. brew install pyenv
  2. pyenv install 3.8.12
  3. pyenv local 3.8.12
  4. curl -sSL https://install.python-poetry.org | python3 -

in my case (Apple M1, macOS 12.4) I overcame the issue and installed poetry successfully using the next command

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 - 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM