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

ImportError: cannot import name is_windows #314

Closed
papachoco opened this issue Feb 24, 2015 · 11 comments
Closed

ImportError: cannot import name is_windows #314

papachoco opened this issue Feb 24, 2015 · 11 comments

Comments

@papachoco
Copy link

httipie (http command) fails to execute with requests 2.5.2 since the latter removed the is_windows from the requests.compat module

Thanks a lot

Carlos

Traceback (most recent call last):
File "/Users/csanchez/Projects/nti.dataserver-buildout/bin/http", line 413, in
import httpie.main
File "/Users/csanchez/Documents/workspace/nti.dataserver-buildout/eggs/httpie-0.9.1-py2.7.egg/httpie/main.py", line 6, in
from .core import main
File "/Users/csanchez/Documents/workspace/nti.dataserver-buildout/eggs/httpie-0.9.1-py2.7.egg/httpie/core.py", line 21, in
from httpie.compat import str, bytes, is_py3
File "/Users/csanchez/Documents/workspace/nti.dataserver-buildout/eggs/httpie-0.9.1-py2.7.egg/httpie/compat.py", line 7, in
from requests.compat import is_windows, bytes, str, is_py3, is_py26
ImportError: cannot import name is_windows

@neokree
Copy link

neokree commented Feb 24, 2015

+1

1 similar comment
@canselcik
Copy link

+1

jkbrzt added a commit that referenced this issue Feb 24, 2015
@jkbrzt
Copy link
Member

jkbrzt commented Feb 24, 2015

Thanks for the report. I've just released v0.9.2 on PyPi to address this issue. Homebrew (Homebrew/legacy-homebrew#37135) and other packages coming soon.

@jkbrzt jkbrzt closed this as completed Feb 24, 2015
pesterhazy added a commit to pesterhazy/nixpkgs that referenced this issue Jun 9, 2015
yaztown pushed a commit to yaztown/httpie that referenced this issue Oct 22, 2015
@jamshid
Copy link

jamshid commented Jan 21, 2016

If you find this issue on a google search, try installing httpie with pip instead of yum.
I just got this ImportError: is_windows error on CentOS 7.2 with the EPEL repo.
EPEL7=http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && curl -sSf -o epel.rpm ${EPEL7} && rpm -ivh epel.rpm
Problem was I installed httpie with yum install -y httpie, which installs a very old version.
Fixed with: yum remove -y httpie and yum install -y python-pip && pip install httpie.

@maxamillion
Copy link

For the sake of posterity, the update to EPEL has been pushed to updates-testing, will hopefully land in stable soon. https://bugzilla.redhat.com/show_bug.cgi?id=1247973

@zWaR
Copy link

zWaR commented Mar 3, 2016

@jamshid thanks, pip install helps :)

@fearphage
Copy link

This is still broken in the Debian/Ubuntu build. I have no target to upgrade to.

➜  documentation git:(master) apt-cache show httpie
Package: httpie
Priority: extra
Section: universe/web
Installed-Size: 222
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Bartosz Fenski <fenio@debian.org>
Architecture: amd64
Version: 0.8.0-1
Depends: python (>= 2.7), python (<< 2.8), python:any (>= 2.7.1-0ubuntu2), python-requests, python-pygments
Filename: pool/universe/h/httpie/httpie_0.8.0-1_amd64.deb
Size: 55500
MD5sum: b63d70a3a3ad9ccdd713306aadd8279c
SHA1: 163be6d2e6db90b7efa907e3fa34796b156d78ab
SHA256: a16bc5a84862ff60408a66f2cd3e2b139c2c79fc00e77e3ba33840389083265b
Description-en: CLI, cURL-like tool for humans
 HTTPie is a CLI HTTP utility that makes CLI interaction with HTTP-based
 services as human-friendly as possible.
 .
 HTTPie does so by providing an http command that allows for issuing
 arbitrary HTTP requests using a simple and natural syntax and
 displaying colorized responses.
Description-md5: a93fec7677de7601feefe5cc8467934c
Homepage: http://httpie.org
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

@jkbrzt
Copy link
Member

jkbrzt commented Apr 8, 2016

@fearphage you could install it via pip for now: $ sudo pip install httpie

@fearphage
Copy link

I couldn't at the time. pip was broken system-wide.

pip install --upgrade pip
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 521, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2632, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2312, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py&
quot;, line 2318, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
    from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead

A version of requests was outdated or something.

Solution: I ended up uninstalling the built-in pip (apt-get remove python-pip) and installed it via another method easy_install --upgrade pip. After that, everything was back to functioning and I reinstalled httpie.

I'm on Ubuntu 15.04 (Vivid) if anyone was wondering.

@jkbrzt
Copy link
Member

jkbrzt commented Apr 8, 2016

Glad you've resolved the issue, @fearphage. Hopefully Ubuntu fixes the package soon (a bug report might be in order btw — https://help.ubuntu.com/community/ReportingBugs).

@diepes
Copy link

diepes commented Aug 21, 2018

Got this error today, on Ubuntu 14.04.5 LTS, wow

$ http 168.63.129.16
Traceback (most recent call last):
  File "/usr/bin/http", line 9, in <module>
    load_entry_point('httpie==0.8.0', 'console_scripts', 'http')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/dist-packages/httpie/__main__.py", line 6, in <module>
    from .core import main
  File "/usr/lib/python2.7/dist-packages/httpie/core.py", line 21, in <module>
    from .compat import str, is_py3
  File "/usr/lib/python2.7/dist-packages/httpie/compat.py", line 6, in <module>
    from requests.compat import (
ImportError: cannot import name is_windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants