Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httpie not working anymore on Mac OS X 10.10.2 #316

Closed
janten opened this issue Mar 3, 2015 · 17 comments
Closed

httpie not working anymore on Mac OS X 10.10.2 #316

janten opened this issue Mar 3, 2015 · 17 comments
Labels
bug Something isn't working

Comments

@janten
Copy link

janten commented Mar 3, 2015

Jan-Gerds-MacBook:radio janten$ http
Traceback (most recent call last):
  File "/usr/local/Cellar/httpie/0.9.2/libexec/bin/http", line 9, in <module>
    load_entry_point('httpie==0.9.2', 'console_scripts', 'http')()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2394, in load_entry_point
    return ep.load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2108, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/Cellar/httpie/0.9.2/libexec/lib/python2.7/site-packages/httpie/__main__.py", line 6, in <module>
    from .core import main
  File "/usr/local/Cellar/httpie/0.9.2/libexec/lib/python2.7/site-packages/httpie/core.py", line 22, in <module>
    from httpie.client import get_response
  File "/usr/local/Cellar/httpie/0.9.2/libexec/lib/python2.7/site-packages/httpie/client.py", line 15, in <module>
    urllib3.disable_warnings()
AttributeError: 'module' object has no attribute 'disable_warnings'
@sigmavirus24
Copy link

This looks to have been installed with brew. I'm not certain how likely it is that this will be easy to debug.

@jkbrzt
Copy link
Member

jkbrzt commented Mar 3, 2015

Interesting. The formula specifies Requests 2.5.2 as a dependency which includes urllib3 with that function. I guess the import picks up another, older version of Requests installed elsewhere.

@jkbrzt jkbrzt added the bug Something isn't working label Mar 3, 2015
@jkbrzt
Copy link
Member

jkbrzt commented Mar 3, 2015

@janten what output do these two commands give you?

$ grep __version__  /usr/local/Cellar/httpie/0.9.2/libexec/vendor/lib/python2.7/site-packages/requests/__init__.py
$ grep disable_warnings /usr/local/Cellar/httpie/0.9.2/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/__init__.py

@janten
Copy link
Author

janten commented Mar 4, 2015

Hello everyone and thanks for your help. @sigmavirus24 is correct, I installed httpie with brew install httpie. I recently installed iPython, maybe this has overwritten requests? In any case, here are the outputs of the commands you proposed.

$ pip freeze | grep requests
requests==2.3.0
$ grep __version__  /usr/local/Cellar/httpie/0.9.2/libexec/vendor/lib/python2.7/site-packages/requests/__init__.py
__version__ = '2.5.2'
$ grep disable_warnings /usr/local/Cellar/httpie/0.9.2/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/__init__.py
def disable_warnings(category=exceptions.HTTPWarning):

@jkbrzt
Copy link
Member

jkbrzt commented Mar 5, 2015

@janten thanks, that looks good. The externally installed Requests should normally not collide, because the script Homebrew installs sets the correct $PYTHONPATH.

Would you also show the output of:

$ echo $PYTHONPATH
$ which http
$ cat "`which http`"

@janten
Copy link
Author

janten commented Mar 7, 2015

$ echo $PYTHONPATH

(seems like $PYTHONPATH is not set)

$ which http
/usr/local/bin/http
$ cat "`which http`"
#!/bin/bash
PYTHONPATH="/usr/local/Cellar/httpie/0.9.2/libexec/lib/python2.7/site-packages:/usr/local/Cellar/httpie/0.9.2/libexec/vendor/lib/python2.7/site-packages" exec "/usr/local/Cellar/httpie/0.9.2/libexec/bin/http" "$@"

@jm3
Copy link

jm3 commented Apr 22, 2015

I'm having the same issue, with similar results:

pip freeze | grep requests
requests==2.3.0

grep __version__  /usr/local/Cellar/httpie/0.9.2_1/libexec/vendor/lib/python2.7/site-packages/requests/__init__.py
__version__ = '2.6.0'

grep disable_warnings /usr/local/Cellar/httpie/0.9.2_1/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/__init__.py
def disable_warnings(category=exceptions.HTTPWarning):

echo $PYTHONPATH

which http
/usr/local/bin/http

cat "`which http`"
#!/bin/bash
PYTHONPATH="/usr/local/Cellar/httpie/0.9.2_1/libexec/lib/python2.7/site-packages:/usr/local/Cellar/httpie/0.9.2_1/libexec/vendor/lib/python2.7/site-packages" exec "/usr/local/Cellar/httpie/0.9.2_1/libexec/bin/http" "$@"

Anything else I can do to help debug this?

@jkbrzt
Copy link
Member

jkbrzt commented Apr 22, 2015

@jm3 could you try to uninstall the globally-installed Requests and try it again?

$ sudo pip uninstall requests

@jm3
Copy link

jm3 commented Apr 23, 2015

@jakubroztocil that did the trick, thanks! /cc @janten

@jkbrzt
Copy link
Member

jkbrzt commented Apr 24, 2015

Great. I wonder if it would be possible to prevent this from happening by tweaking the formula.

@anentropic
Copy link

I'm getting this error without any homebrew install (pip installed, inside a virtualenv)

According to pip, httpie requires requests >= 2.3.0

I have requests 2.3.0 installed and it doesn't work

doing a pip install --upgrade httpie brings requests 2.7.0 and now it works

does the setup.py need updating?

@itkach
Copy link

itkach commented Sep 21, 2015

I am getting the same error, also installed with pip in a virtualenv:

% pip install httpie
Downloading/unpacking httpie
  Downloading httpie-0.9.2-py2.py3-none-any.whl (66kB): 66kB downloaded
Requirement already satisfied (use --upgrade to upgrade): requests>=2.3.0 in ./.virtualenvs/t/lib/python2.7/site-packages (from httpie)
Requirement already satisfied (use --upgrade to upgrade): Pygments>=1.5 in ./.virtualenvs/t/lib/python2.7/site-packages (from httpie)
Installing collected packages: httpie
Successfully installed httpie
% pip freeze | grep requests
requests==2.3.0

@jeanferri
Copy link

@anentropic may you have an older version of urllib3 without disable_warnings method and using it instead?

@sigmavirus24
Copy link

@hangtwenty if installing everything from pip, then that will not help anyone.

@floer32
Copy link

floer32 commented Dec 2, 2015

@sigmavirus24 OK nevermind, I was trying to relay something said by someone at work using Windows. I don't use Windows myself so I couldn't validate. Deleted comment so it won't mislead anyone

@jkbrzt
Copy link
Member

jkbrzt commented Jan 7, 2016

This issue should be fixed in 0.9.3.

@jkbrzt jkbrzt closed this as completed Jan 7, 2016
@bheemreddy181-zz
Copy link

locking httpie to 0.9.4 resolves this issue

 pip install httpie==0.9.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants