Httpie: خطأ في الاستيراد: لا توجد وحدة باسم "pkg_resources"

تم إنشاؤها على ١٩ أغسطس ٢٠١٦  ·  7تعليقات  ·  مصدر: httpie/httpie

➜ ~ http --help
Traceback (آخر مكالمة أخيرة):
ملف "/usr/local/Cellar/httpie/0.9.4/libexec/bin/http" ، السطر 5 ، في
من pkg_resources استيراد load_entry_point
خطأ في الاستيراد: لا توجد وحدة باسم "pkg_resources"

التعليق الأكثر فائدة

أنا فقط واجهت هذا أيضا. بالنظر إلى خطأ التثبيت ، رأيت هذا:

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

لإصلاح ذلك ، ركضت:

✗ unset PYTHONPATH
✗ brew postinstall python3

ثم جرب 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>

بعد تثبيت python3 بشكل صحيح ، فإنه يعمل (حتى مع تعيين PYTHONPATH على القيمة القديمة).

أعتقد أن هذا قد تضاعف أيضًا من خلال الإصدار 1.0.0 الأخير من brew - يبدو أنه قد غيّر عددًا من عناصر python بالنسبة لي ، واضطررت إلى إعادة تثبيت عدد من الحزم.

ال 7 كومينتر

صدم

badjano هذا إصدار قديم. يحاول:

$ brew update && brew upgrade httpie

Traceback (آخر مكالمة أخيرة):
ملف "/usr/local/Cellar/httpie/0.9.6/libexec/bin/http" ، السطر 5 ، في
من pkg_resources استيراد load_entry_point
خطأ في الاستيراد: لا توجد وحدة باسم "pkg_resources"

لدي زميل لديه نفس جهاز Mac ، لكنه يعمل على جهازه ، لقد أعدت تثبيت python ، و pip ، و setuptools ، وترقية الشراب ، وكل شيء ، وما زلت لا أستطيع معرفة ما يجري

أنا فقط واجهت هذا أيضا. بالنظر إلى خطأ التثبيت ، رأيت هذا:

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

لإصلاح ذلك ، ركضت:

✗ unset PYTHONPATH
✗ brew postinstall python3

ثم جرب 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>

بعد تثبيت python3 بشكل صحيح ، فإنه يعمل (حتى مع تعيين PYTHONPATH على القيمة القديمة).

أعتقد أن هذا قد تضاعف أيضًا من خلال الإصدار 1.0.0 الأخير من brew - يبدو أنه قد غيّر عددًا من عناصر python بالنسبة لي ، واضطررت إلى إعادة تثبيت عدد من الحزم.

شكرًا sheeley ، لقد نجح هذا معي ، على الرغم من أن python3 الخاص بي لم يكن مرتبطًا وقررت فرض إلغاء تثبيته وتثبيته مرة أخرى ، وهو يعمل الآن!

حدث هذا لي بعد أن قمت بترقية npm من 3.10.10 إلى 4.0.5 ... جربت حل sheeyey لكنه لم ينجح معي. كان الإصلاح الذي أجريته هو brew uninstall httpie ثم brew install httpie . الآن عدت إلى طبيعتي. لمعلوماتك .... كان هذا على جهاز MacBook Pro الخاص بي (أوائل 2011) الذي يعمل بنظام macOS 10.9.5

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات