Httpie: ImportError: Kein Modul namens 'pkg_resources'

Erstellt am 19. Aug. 2016  ·  7Kommentare  ·  Quelle: httpie/httpie

➜ ~ http --Hilfe
Traceback (letzter Aufruf zuletzt):
Datei "/usr/local/Cellar/httpie/0.9.4/libexec/bin/http", Zeile 5, in
aus pkg_resources import load_entry_point
ImportError: Kein Modul namens 'pkg_resources'

Hilfreichster Kommentar

Ich bin auch gerade darauf gestoßen. Als ich mir den Installationsfehler ansah, sah ich Folgendes:

==> Installing dependencies for httpie: python3
==> Installing httpie dependency: python3
==> Downloading https://homebrew.bintray.com/bottles/python3-3.5.2_1.el_capitan.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring python3-3.5.2_1.el_capitan.bottle.2.tar.gz
==> Using the sandbox
==> /usr/local/Cellar/python3/3.5.2_1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python3/3.5.2_1/bin --install-lib=/usr/local/lib/python3.5/site-pa
Last 15 lines from /Users/jsheeley/Library/Logs/Homebrew/python3/post_install.01.python3:
-s
setup.py
--no-user-cfg
install
--force
--verbose
--install-scripts=/usr/local/Cellar/python3/3.5.2_1/bin
--install-lib=/usr/local/lib/python3.5/site-packages
--single-version-externally-managed
--record=installed.txt

Failed to import the site module
Your PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x!
     PYTHONPATH is currently: "/Library/Python/2.7/site-packages:/usr/local/lib/python2.7/site-packages:/Users/jsheeley/.venvburrito/lib/python2.7/site-packages"
     You should `unset PYTHONPATH` to fix this.
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall python3`
==> Caveats
Pip, setuptools, and wheel have been installed. To update them
  pip3 install --upgrade pip setuptools wheel
... (etc)

Um das zu beheben, lief ich:

✗ unset PYTHONPATH
✗ brew postinstall python3

Versuchen Sie dann httpie:

✗ http google.com
HTTP/1.1 301 Moved Permanently
Cache-Control: public, max-age=2592000
Content-Length: 219
Content-Type: text/html; charset=UTF-8
Date: Fri, 23 Sep 2016 04:34:37 GMT
Expires: Sun, 23 Oct 2016 04:34:37 GMT
Location: http://www.google.com/
Server: gws
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>

Nach der ordnungsgemäßen Installation von python3 funktioniert es (auch wenn PYTHONPATH auf den alten Wert gesetzt ist).

Ich denke, dies wird auch durch die jüngste Version 1.0.0 von Brew verstärkt - es scheint eine Reihe von Python-Dingen für mich geändert zu haben, und ich musste eine Reihe von Paketen neu installieren.

Alle 7 Kommentare

stoßen

@badjano das ist eine alte Version. Versuchen:

$ brew update && brew upgrade httpie

Traceback (letzter Aufruf zuletzt):
Datei "/usr/local/Cellar/httpie/0.9.6/libexec/bin/http", Zeile 5, in
aus pkg_resources import load_entry_point
ImportError: Kein Modul namens 'pkg_resources'

Ich habe einen Kollegen, der den gleichen Mac hat, aber es funktioniert auf seinem, ich habe Python, Pip, Setuptools, Brew Upgrade, alles neu installiert, kann immer noch nicht herausfinden, was los ist

Ich bin auch gerade darauf gestoßen. Als ich mir den Installationsfehler ansah, sah ich Folgendes:

==> Installing dependencies for httpie: python3
==> Installing httpie dependency: python3
==> Downloading https://homebrew.bintray.com/bottles/python3-3.5.2_1.el_capitan.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring python3-3.5.2_1.el_capitan.bottle.2.tar.gz
==> Using the sandbox
==> /usr/local/Cellar/python3/3.5.2_1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python3/3.5.2_1/bin --install-lib=/usr/local/lib/python3.5/site-pa
Last 15 lines from /Users/jsheeley/Library/Logs/Homebrew/python3/post_install.01.python3:
-s
setup.py
--no-user-cfg
install
--force
--verbose
--install-scripts=/usr/local/Cellar/python3/3.5.2_1/bin
--install-lib=/usr/local/lib/python3.5/site-packages
--single-version-externally-managed
--record=installed.txt

Failed to import the site module
Your PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x!
     PYTHONPATH is currently: "/Library/Python/2.7/site-packages:/usr/local/lib/python2.7/site-packages:/Users/jsheeley/.venvburrito/lib/python2.7/site-packages"
     You should `unset PYTHONPATH` to fix this.
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall python3`
==> Caveats
Pip, setuptools, and wheel have been installed. To update them
  pip3 install --upgrade pip setuptools wheel
... (etc)

Um das zu beheben, lief ich:

✗ unset PYTHONPATH
✗ brew postinstall python3

Versuchen Sie dann httpie:

✗ http google.com
HTTP/1.1 301 Moved Permanently
Cache-Control: public, max-age=2592000
Content-Length: 219
Content-Type: text/html; charset=UTF-8
Date: Fri, 23 Sep 2016 04:34:37 GMT
Expires: Sun, 23 Oct 2016 04:34:37 GMT
Location: http://www.google.com/
Server: gws
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>

Nach der ordnungsgemäßen Installation von python3 funktioniert es (auch wenn PYTHONPATH auf den alten Wert gesetzt ist).

Ich denke, dies wird auch durch die jüngste Version 1.0.0 von Brew verstärkt - es scheint eine Reihe von Python-Dingen für mich geändert zu haben, und ich musste eine Reihe von Paketen neu installieren.

Danke @sheeley , das hat bei mir funktioniert, obwohl mein python3 nicht verlinkt war und ich beschlossen habe, es zu deinstallieren und erneut zu installieren, und jetzt funktioniert es!

Dies ist mir passiert, nachdem ich npm von 3.10.10 auf 4.0.5 aktualisiert habe ... Ich habe die @sheeley- Lösung ausprobiert, aber sie hat bei mir nicht funktioniert. Mein Fix war brew uninstall httpie dann brew install httpie . Jetzt bin ich wieder normal. FYI .... Dies war auf meinem MacBook Pro (Anfang 2011) mit macOS 10.9.5

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen