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

http: error: InvalidSchema: Missing dependencies for SOCKS support. despite installing requests[socks] #904

Closed
cl-ax opened this issue Apr 27, 2020 · 5 comments

Comments

@cl-ax
Copy link

cl-ax commented Apr 27, 2020

I followed the documentation's instructions to install requests[socks] with pip -U requests[socks], but I'm still getting the error.

$ http --version
0.9.8

Using Ubuntu 18.04 with the following env vars set:

$ env | grep -i proxy
HTTP_PROXY=socks5h://localhost:8118
FTP_PROXY=socks5h://localhost:8118
http_proxy=socks5h://localhost:8118
ALL_PROXY=socks5h://localhost:8118
NO_PROXY=localhost,127.0.0.0/8,::1,company.com
HTTPS_PROXY=socks5h://localhost:8118
RSYNC_PROXY=socks5h://localhost:8118

httpie installed with sudo apt install httpie

@cl-ax cl-ax changed the title http: error: InvalidSchema: Missing dependencies for SOCKS support. http: error: InvalidSchema: Missing dependencies for SOCKS support. despite installing requests[socks] Apr 27, 2020
@jkbrzt
Copy link
Member

jkbrzt commented Apr 29, 2020

It’s possible that the apt-installed version of HTTPie does not have access to the additional pip-installed packages, for some reason. Also, HTTPie 0.9.8 is very old (it might be unrelated, though). I would try to install HTTPie using pip instead.

@cl-ax
Copy link
Author

cl-ax commented Apr 30, 2020

I must be doing something wrong... I tried installing with pip after removing using apt, but I'm now getting errors when trying to run httpie:

$ pip install -U httpie
Collecting httpie
  Using cached https://files.pythonhosted.org/packages/96/42/d2d51ef0d6e9c9ab1c94313f08813ece14bdc3d5b6d8f22abb8fe6f3dad9/httpie-2.0.0-py2.py3-none-any.whl
Collecting Pygments>=2.5.2 (from httpie)
  Using cached https://files.pythonhosted.org/packages/be/39/32da3184734730c0e4d3fa3b2b5872104668ad6dc1b5a73d8e477e5fe967/Pygments-2.5.2-py2.py3-none-any.whl
Collecting requests>=2.22.0 (from httpie)
  Using cached https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests>=2.22.0->httpie)
  Using cached https://files.pythonhosted.org/packages/e1/e5/df302e8017440f111c11cc41a6b432838672f5a70aa29227bf58149dc72f/urllib3-1.25.9-py2.py3-none-any.whl
Collecting chardet<4,>=3.0.2 (from requests>=2.22.0->httpie)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.22.0->httpie)
  Using cached https://files.pythonhosted.org/packages/57/2b/26e37a4b034800c960a00c4e1b3d9ca5d7014e983e6e729e33ea2f36426c/certifi-2020.4.5.1-py2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests>=2.22.0->httpie)
  Using cached https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl
Installing collected packages: Pygments, urllib3, chardet, certifi, idna, requests, httpie
Successfully installed Pygments-2.5.2 certifi-2020.4.5.1 chardet-3.0.4 httpie-2.0.0 idna-2.9 requests-2.23.0 urllib3-1.25.9

$ http --help
Traceback (most recent call last):
  File "/home/user/.local/bin/http", line 11, in <module>
    sys.exit(main())
  File "/home/user/.local/lib/python2.7/site-packages/httpie/__main__.py", line 10, in main
    from .core import main
  File "/home/user/.local/lib/python2.7/site-packages/httpie/core.py", line 21
    args: List[Union[str, bytes]] = sys.argv,
        ^
SyntaxError: invalid syntax

@jkbrzt
Copy link
Member

jkbrzt commented Apr 30, 2020

@coaxial-abraxas can you please tell me what Python version you use?

$ python --version

I assume it will be older than the 3.6, which is required by HTTPie 2.0.0+. The following should work:

$ pip install 'httpie<2.0.0'

(This is indeed a bug: #886)

@httpie httpie deleted a comment May 2, 2020
@cl-ax
Copy link
Author

cl-ax commented May 4, 2020

For the time being, I have installed it with python3 -m pip install -U httpie. My Python3 is 3.6.9, and python is 2.7.17. Now using httpie 2.1.0 without issue.

$ python --version
Python 2.7.17

$ python3 --version
Python 3.6.9

$ http --version
2.1.0

@jkbrzt
Copy link
Member

jkbrzt commented Jun 18, 2020

HTTPie 2.3.0 will support SOCKS out of the box w/o extra installation.

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

No branches or pull requests

2 participants