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

ibm-db version 3.1.0 fails to install on python 2.7.5 #671

Closed
meathead23 opened this issue Oct 6, 2021 · 5 comments
Closed

ibm-db version 3.1.0 fails to install on python 2.7.5 #671

meathead23 opened this issue Oct 6, 2021 · 5 comments
Assignees
Labels
Documentation Issue need Doc update

Comments

@meathead23
Copy link

Issue:

ibm-db 3.1.0 breaks when installing with python 2.7.5(yes I know that's out of support)

3.0.4 install:

[root@ssdbpp-d148-001 ~]# pip install ibm-db==3.0.4
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting ibm-db==3.0.4
  Downloading ibm_db-3.0.4.tar.gz (796 kB)
     |████████████████████████████████| 796 kB 9.7 MB/s
Using legacy 'setup.py install' for ibm-db, since package 'wheel' is not installed.
Installing collected packages: ibm-db
    Running setup.py install for ibm-db ... done
Successfully installed ibm-db-3.0.4
WARNING: You are using pip version 20.3.1; however, version 20.3.4 is available.
You should consider upgrading via the '/usr/bin/python2 -m pip install --upgrade pip' command.

3.1.0 install:

[root@ssdbpp-d148-001 ~]# pip install ibm-db==3.1.0
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting ibm-db==3.1.0
  Using cached ibm_db-3.1.0.tar.gz (797 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python2 /usr/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpNvHRtW
       cwd: /tmp/pip-install-spAM5A/ibm-db
  Complete output (18 lines):
  Detected 64-bit Python
  Downloading https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz
  Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/usr/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-R0uwwa/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 146, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-R0uwwa/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 127, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-R0uwwa/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 142, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 240, in <module>
      file_stream = BytesIO(request.urlopen(url, context=context).read())
  TypeError: initial_value must be unicode or None, not str
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python2 /usr/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpNvHRtW Check the logs for full command output.
WARNING: You are using pip version 20.3.1; however, version 20.3.4 is available.
You should consider upgrading via the '/usr/bin/python2 -m pip install --upgrade pip' command.

the previous version 3.0.4 works fine, whereas 3.1.0 fails on installation.

@drpoggi
Copy link
Contributor

drpoggi commented Oct 6, 2021

Also seeing this issue with Python 2.7.17

Seems to have been introduced in #661. I tested locally and changing this line from from io import StringIO as BytesIO back to from cStringIO import StringIO as BytesIO resolves the issue

@amukherjee28
Copy link
Member

Hi @meathead23 @meathead23

In the attempt to fix the breaking changes for new version of setuptools (58>) the support for 2to3 has been removed. As a result of these changes we have fixed the code to remove the dependency on 2to3.

Since python 2 is almost at the end of support the main care area was python3. With python2 the setuptools continue to use the old version (from pip) as the new version upgrade is only in effect from python3 pip versions.

In case you are using python2 I would suggest you to continue using 3.0.4 and the new version is mainly targeted for python3 users with setuptools version > 58.

This is the reason we have changed the version number to 3.1 versions.

I would suggest to continue using pip install ibm_db==3.0.4 in case you are using python2 for now.

Let me your suggestion on the same.

@meathead23
Copy link
Author

meathead23 commented Oct 7, 2021

@amukherjee28 yes I've already switched our dependencies to use 3.0.4 to fix the issue. However as @drpoggi suggests you might want to make the change above to fix python 2 support or the alternative is going though all your documentation and changing/removing any references to python 2 or adding warnings to only use upto 3.0.4 for Python 2. Also is there any reason why the pypi page shows the latest version as 3.1.0 but github shows 3.0.4?

@amukherjee28
Copy link
Member

@meathead23 I have tagged the new release with git.

Going forward plan is to maintain the 3.1.x version for python3 and above and for python2 will suggest users to install 3.0.4.
I will have the documents updated.

@bimalkjha bimalkjha added the Documentation Issue need Doc update label Nov 26, 2021
@amukherjee28
Copy link
Member

@meathead23 in the latest release 3.1.1 fixed the python2 dependency issue as well.

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

No branches or pull requests

4 participants