Exception while installing IBM db with python

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
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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\A1029532\AppData\Local\Temp\pip-install-t916jcni\ibm-db\setup.py", line 207, in <module>
    file_stream = BytesIO(request.urlopen(url, context=context).read())
  File "c:\users\a1029532\appdata\local\programs\python\python36\lib\urllib\request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "c:\users\a1029532\appdata\local\programs\python\python36\lib\urllib\request.py", line 526, in open
    response = self._open(req, data)
  File "c:\users\a1029532\appdata\local\programs\python\python36\lib\urllib\request.py", line 544, in _open
    '_open', req)
  File "c:\users\a1029532\appdata\local\programs\python\python36\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "c:\users\a1029532\appdata\local\programs\python\python36\lib\urllib\request.py", line 1361, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "c:\users\a1029532\appdata\local\programs\python\python36\lib\urllib\request.py", line 1320, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error Tunnel connection failed: 400 Bad Request>

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in C:\Users\A1029532\AppData\Local\Temp\pip-install-t916jcni\ibm-db\

Please suggest something to resolve this issue, I am blocked due to this issue.

Thanks,

Hi @Gaurav

either it is not robotFramework related or it happens only on a machine with robot Framework installed

if it’s the case i suggest you to use virtual env in python to isolate the environnement

hope this help or i do not have understood your question

Casper

As explained in that thread, your network setup is most likely culprint for the issue - 0 chance that this has anything to do with robot framework.

One option, which i already mentioned is (install manually and modify the url in setup.py to something that your proxy can access):

  1. download the release.
  2. unpack the source release to a directory
  3. fix the issues in setup.py

Worth checking is http_proxy and https_proxy environment variables …

I tried to install same in VDI environment. Also taking care for Proxy Server issue. But still not able to install ibm_db library. I may agree that this issue is not directly related to Robot Framework but i am following same instruction as mentioned in Robot Framework guide and using same command as available on python website.

image

Please provide some solution.

Thanks,