Httpie: ImportError: Tidak ada modul bernama 'pkg_resources'

Dibuat pada 19 Agu 2016  ·  7Komentar  ·  Sumber: httpie/httpie

~ http --help
Traceback (panggilan terakhir terakhir):
File "/usr/local/Cellar/httpie/0.9.4/libexec/bin/http", baris 5, di
dari pkg_resources impor load_entry_point
ImportError: Tidak ada modul bernama 'pkg_resources'

Komentar yang paling membantu

Saya baru saja mengalami ini juga. Melihat kesalahan pemasangan, saya melihat ini:

==> 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)

Untuk memperbaikinya, saya menjalankan:

✗ unset PYTHONPATH
✗ brew postinstall python3

Kemudian, coba 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>

Setelah menginstal python3 dengan benar, ini berfungsi (bahkan dengan PYTHONPATH disetel ke nilai lama).

Saya pikir ini diperparah juga oleh rilis 1.0.0 brew baru-baru ini - tampaknya telah mengubah sejumlah hal python untuk saya, dan saya harus menginstal ulang sejumlah paket.

Semua 7 komentar

menabrak

@badjano itu versi lama. Mencoba:

$ brew update && brew upgrade httpie

Traceback (panggilan terakhir terakhir):
File "/usr/local/Cellar/httpie/0.9.6/libexec/bin/http", baris 5, di
dari pkg_resources impor load_entry_point
ImportError: Tidak ada modul bernama 'pkg_resources'

Saya memiliki seorang rekan yang memiliki mac yang sama, tetapi bekerja pada macnya, saya menginstal ulang python, pip, setuptools, brew upgrade, semuanya, masih tidak tahu apa yang sedang terjadi

Saya baru saja mengalami ini juga. Melihat kesalahan pemasangan, saya melihat ini:

==> 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)

Untuk memperbaikinya, saya menjalankan:

✗ unset PYTHONPATH
✗ brew postinstall python3

Kemudian, coba 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>

Setelah menginstal python3 dengan benar, ini berfungsi (bahkan dengan PYTHONPATH disetel ke nilai lama).

Saya pikir ini diperparah juga oleh rilis 1.0.0 brew baru-baru ini - tampaknya telah mengubah sejumlah hal python untuk saya, dan saya harus menginstal ulang sejumlah paket.

Terima kasih @sheeley , ini berhasil untuk saya, meskipun python3 saya tidak ditautkan dan saya memutuskan untuk memaksa uninstall dan menginstalnya lagi, dan sekarang berhasil!

Ini terjadi pada saya setelah saya memutakhirkan npm dari 3.10.10 ke 4.0.5... Saya mencoba solusi @sheeley tetapi tidak berhasil untuk saya. Perbaikan saya adalah brew uninstall httpie lalu brew install httpie . Sekarang aku kembali normal. FYI.... Ini ada di MacBook Pro saya (Awal 2011) yang menjalankan macOS 10.9.5

Apakah halaman ini membantu?
0 / 5 - 0 peringkat

Masalah terkait

pyvotal-cguers picture pyvotal-cguers  ·  5Komentar

Govinda-Fichtner picture Govinda-Fichtner  ·  6Komentar

hrj picture hrj  ·  5Komentar

maciej picture maciej  ·  4Komentar

victorhooi picture victorhooi  ·  4Komentar