Issue in installing ibm_db with pip

Hi,
I am facing issue while installing ibm db with python. Please do let me know, how to resolve this issue.

Command: pip install ibm_db
Python version: 3.6.7
Robot Framework: 3.2.1

Exception:
Collecting ibm_db
Using cached https://files.pythonhosted.org/packages/6f/4e/48bf113d4f14b20a5008ea9f7784654041d8f7730c1081b370f569d80c93/ibm_db-3.0.2.tar.gz
Complete output from command python setup.py egg_info:
Detected 64-bit Python
Downloading https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip
Traceback (most recent call last):
File “c:\users\a1029532\appdata\local\programs\python\python36\lib\urllib\request.py”, line 1318, in do_open
encode_chunked=req.has_header(‘Transfer-encoding’))
File “c:\users\a1029532\appdata\local\programs\python\python36\lib\http\client.py”, line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File “c:\users\a1029532\appdata\local\programs\python\python36\lib\http\client.py”, line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File “c:\users\a1029532\appdata\local\programs\python\python36\lib\http\client.py”, line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File “c:\users\a1029532\appdata\local\programs\python\python36\lib\http\client.py”, line 1026, in _send_output
self.send(msg)
File “c:\users\a1029532\appdata\local\programs\python\python36\lib\http\client.py”, line 964, in send
self.connect()
File “c:\users\a1029532\appdata\local\programs\python\python36\lib\http\client.py”, line 1392, in connect
super().connect()
File “c:\users\a1029532\appdata\local\programs\python\python36\lib\http\client.py”, line 940, in connect
self._tunnel()
File “c:\users\a1029532\appdata\local\programs\python\python36\lib\http\client.py”, line 919, in _tunnel
message.strip()))
OSError: Tunnel connection failed: 400 Bad Request

Nothing really to do with robotframework. It looks like you are behind proxy, ibm_db python package tries to download another file ( https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip ) with urllib.request during the installation and that fails because of error 400. Most likely because of your proxy setup.

Hey Jani!

Thanks for your reply!
We are setting proxy before executing the command and still getting this error.
And I observed, when we don’t set proxy it normally throws Timeout Error for any installation.
Will there be any other reason for this error to occur?

Regards!

Try if you can actually download the url that fails with like curl or wget by using same proxy settings. If that fails, it’s probably your proxy messing up. And with those tools you might have some options to debug why it might fail.

Or install manually and modify the url in setup.py to something that your proxy can access.