IBM / ibm-cos-sdk-python

ibm-cos-sdk-python
Apache License 2.0
44 stars 26 forks source link

ModuleNotFoundError: No module named 'requests' after latest release #28

Closed gabrieldrs closed 4 years ago

gabrieldrs commented 4 years ago

It looks like the latest release is causing the following error to occur at runtime after a fresh pip install:

Traceback (most recent call last):
  File "/.../python3.7/site-packages/ibm_boto3/__init__.py", line 16, in <module>
    from ibm_boto3.session import Session
  File "/.../python3.7/site-packages/ibm_boto3/session.py", line 27, in <module>
    import ibm_botocore.session
  File "/.../python3.7/site-packages/ibm_botocore/session.py", line 29, in <module>
    import ibm_botocore.configloader
  File "/.../python3.7/site-packages/ibm_botocore/configloader.py", line 19, in <module>
    from ibm_botocore.compat import six
  File "/.../python3.7/site-packages/ibm_botocore/compat.py", line 25, in <module>
    from ibm_botocore.exceptions import MD5UnavailableError
  File "/.../python3.7/site-packages/ibm_botocore/exceptions.py", line 16, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'
cpcunningham commented 4 years ago

Hi @gabrieldrs - can you give us some details 1) 3.7.0 --- is this the version of python you are using 2) pip install ibm-cos-sdk -- is this how you installed it 3) had you a previous version of the sdk installed

gabrieldrs commented 4 years ago

Hey, I'm using python 3.7, I installed it with pip install ibm-cos-sdk==2.5.2, and that was the version I wa previously using, but it looks like during setup, ibm-cos-sdk requires ibm-cos-sdk-core>2.0.0 (https://github.com/IBM/ibm-cos-sdk-python/blob/master/setup.py#L18) so I end up receiving the latest core release, even though I'm specifying version 2.5.2

I took a look at the latest release and it seems like requests is missing in the requirement list of core-sdk, I opened a pr with the proposed solution: https://github.com/IBM/ibm-cos-sdk-python-core/pull/7

Im not sure if the problem only occurs when installing a previous release of this package, will try to install the latest release later.

cpcunningham commented 4 years ago

Thx for the details.. prior to release 2.5.4 - the sdk used the internal vendored/requests from 2.5.4 - the sdk uses the external requests package

can you install the latest version pip install ibm-cos-sdk==2.5.4 - this should install the requests package

We will review our setup dependencies in our month end patch release..

gabrieldrs commented 4 years ago

I've just tried installing the latest release, and the problem persists. In order to replicate:

  1. create a clean virtualenv with python 3.7.0
  2. run pip install ibm-cos-sdk
  3. run python -m ibm_boto3

I really think that the problem is that ibm-cos-sdk-python-core is missing the required dependency in its setup script. Since the internal was removed, the external should be added to the requires list in the setup.py script.

cpcunningham commented 4 years ago

thx @gabrieldrs - we will add this to our pypi release at the end of month - in mean time can you install requests manually. we will update our tests to catch this issue...

gabrieldrs commented 4 years ago

I can, it's just a bit of a hassle to change all of our (10+) microservices devOps process to have this patch until it's officially fixed, and then, once it's fixed, I will have to go back and undo the fix on all of these projects. Would be nice if a hotfix could come from the official repository sooner so I wouldn't need to change every container which depends on this library...

cpcunningham commented 4 years ago

@gabrieldrs - Sorry for the delay - this issue has now been fixed in release 2.5.5