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.

Poetry fails to install on macOS High Sierra using Homebrew Python 3

See original GitHub issue

Poetry fails to install on macOS High Sierra (10.13.4) using Homebrew Python 3 (3.6.5).

$ curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python3
Retrieving metadata

Installing version: 0.8.5
  - Getting dependencies
An error has occured: Command '('python', '-m', 'pip', 'install', 'poetry==0.8.5', '--target', '/var/folders/zk/1bgll_755dddcqh6snjdsmt00000gn/T/poetry-installer-ra11xs2z/dist')' returned non-zero exit status 1.
b'/usr/bin/python: No module named pip\n'

The reason this happens is the Installer.call() method has python hardcoded as the Python executable name. In my opinion, this is a soft violation of PEP 394. To solve this problem, call sys.executable to obtain the filesystem location of the version of Python running the get-poetry.py script. Pull request #60 has a suggested fix.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
bradjcommented, Apr 28, 2018

I appear to be having the same issue. Here is the command being run (ran?)… runded (that’s definitely right):

Command '('/usr/local/opt/python/bin/python3.6', '-m', 'pip', 'install', 'poetry==0.8.5', '--target', '/var/folders/3v/j70_9wm15ln0jg8whc_tq8wm0000gn/T/poetry-installer-zwa96x3h/dist')'

And the error being output:

distutils.errors.DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both

This StackOverflow post fixed my issue but I am not sure I like the fix since it’s a system wide setting but I don’t know enough about the context around pip/homebrew to come up with another workaround. I am using your version of get_poetry.py, @lgw4 .

I don’t really have much helpful input. Only saying I was also affected.

1reaction
lgw4commented, May 11, 2018

@pawelad Unfortunately, installing pipsi on macOS using Python 3 from Homebrew is also broken (perhaps for the same reasons; this is a problem with how the Homebrew packagers are configuring the Python installation). pipsi can be made to work with Homebrew’s Python 3, but doing so is quite hacky. FWIW, I love the idea of pipsi and wish it was a default part of Python.

Read more comments on GitHub >

github_iconTop Results From Across the Web

poetry installation failing on Mac OS, says ... - Stack Overflow
In my case, the problem was the global version of python set by pyenv was not python 3.x. So pyenv global 3.x.x. fixed...
Read more >
Installing Python 3 on Mac OS X
The latest version of Mac OS X, High Sierra, comes with Python 2.7 out of the box. You do not need to install...
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
Read more >
Remove and Reinstall Python on Mac -- Can I trust these old ...
I am using macOS version 10.12.6 and simply uninstalling and re-installing worked for me: brew uninstall --ignore-dependencies python3.
Read more >
An Effective Python Environment: Making Yourself at Home
If you install WSL, then you can use zsh , bash , or any other Unix-like shell. ... As of this writing, macOS...
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