pip install error: Missing dependencies for SOCKS support
Asked Answered
R

6

6

When I try to use pip install, it keeps throwing this error.

$ pip install django
ERROR: Could not install packages due to an OSError: Missing dependencies for SOCKS support.

I tried installing request[socks], but then I get an error saying that it cannot make out the socks version.

The following is the proxy setting on my system:

$ printenv | grep -i proxy
NO_PROXY=localhost,127.0.0.0/8,::1
http_proxy=http://proxy.iiit.ac.in:8080/
FTP_PROXY=http://proxy.iiit.ac.in:8080/
ftp_proxy=http://proxy.iiit.ac.in:8080/
all_proxy=socks://proxy.iiit.ac.in:8080/
ALL_PROXY=socks://proxy.iiit.ac.in:8080/
https_proxy=http://proxy.iiit.ac.in:8080/
HTTPS_PROXY=http://proxy.iiit.ac.in:8080/
no_proxy=localhost,127.0.0.0/8,::1
HTTP_PROXY=http://proxy.iiit.ac.in:8080/
Rayraya answered 2/12, 2016 at 6:20 Comment(2)
Did you check out the link #38794515Nakashima
yes it worked.. i had to set all_proxy as https protocolRayraya
S
4

I was also not able to install Django and other stuffs after activating venv than I finally did this [1]

type: sudo gedit .bashrc #or any text editor if gedit is not there 

      add this line at the last of your .bashrc file 
      export all_proxy="https://your_proxy:your_port/"

save the changes it should work. Thanks

Ref. [1] https://mcmap.net/q/223187/-python-39-s-requests-quot-missing-dependencies-for-socks-support-quot-when-using-socks5-from-terminal

Santinasantini answered 18/5, 2017 at 13:55 Comment(0)
H
14
  1. Unset socks proxy, in your case: unset all_proxy unset ALL_PROXY
  2. Install missing dependencies: pip install pysocks
  3. Reset proxy, source .bashrc, and pip install works again with socks proxy.
Halfbound answered 31/3, 2017 at 8:17 Comment(0)
S
4

I was also not able to install Django and other stuffs after activating venv than I finally did this [1]

type: sudo gedit .bashrc #or any text editor if gedit is not there 

      add this line at the last of your .bashrc file 
      export all_proxy="https://your_proxy:your_port/"

save the changes it should work. Thanks

Ref. [1] https://mcmap.net/q/223187/-python-39-s-requests-quot-missing-dependencies-for-socks-support-quot-when-using-socks5-from-terminal

Santinasantini answered 18/5, 2017 at 13:55 Comment(0)
C
1

If access to the Internet must go through the SOCKS proxy, the standard command to pip install pysocks will never work, as there wouldn't be the required SOCKS support in place to install the package that provides it, effectively creating a chicken and egg problem.

To get around this, navigate to https://pypi.org/project/PySocks/#files, and download the wheel relevant to the version of Python being used, and manually install it using pip install -U /path/to/wheel, e.g.

$ pip install -U pip
ERROR: Could not install packages due to an OSError: Missing dependencies for SOCKS support.
$ pip install pysocks
ERROR: Could not install packages due to an OSError: Missing dependencies for SOCKS support.
$ wget https://files.pythonhosted.org/.../PySocks-1.7.1-py3-none-any.whl
...
2024-04-06 00:00:00 (84.5 MB/s) - ‘PySocks-1.7.1-py3-none-any.whl’ saved [16725/16725]
$ pip install -U PySocks-1.7.1-py3-none-any.whl 
...
Successfully installed PySocks-1.7.1
$ pip install -U pip
...
Successfully installed pip-24.0

In the example above I used wget, it may not be available on your platform, so you may need to use an alternative command, or simply a web browser (most commonly found on Windows) to download the file, and use the same pip install -U command on the path to the downloaded file.

Comprehensible answered 6/4, 2024 at 11:3 Comment(0)
H
0

This is what worked for me pip install --user --proxy https://user:pass@proxyaddress:port django

Helicoid answered 6/4, 2017 at 6:46 Comment(0)
P
0

I got the same problem when I used the command pip install to install any modules. Even I tried to use the command pip install pysocks

ERROR: Could not install packages due to an OSError: Missing dependencies for SOCKS support.

I have tried all the possible solutions over the internet, but all were failed. I tried to ask 'Claude.ai', and it gave me the solution and solve my problem. It told me to install the pysocks manually with the command of Pysocksthe python -m pip install C:\Temp\PySocks-1.7.1-py3-none-any.whl`, then the issue was solved. I don't know if this solution is works well for others, and I hope this solution helps. My system configurations are:

  • Windows 11 Home Edition
  • Python 3.11.4
  • Pip 24.2
Phlebotomy answered 29/7, 2024 at 3:57 Comment(0)
A
-1

Uninstall the installed package using

pip uninstall packagename

and set the proxy

http_proxy=http://username:password@host:port/
https_proxy=https://username:password@host:port/ 

and try to install using

pip install packagename
Ashy answered 25/4, 2018 at 10:21 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.