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

Dependencies not specified #191

Closed
jamesrwhite opened this issue Apr 10, 2018 · 7 comments
Closed

Dependencies not specified #191

jamesrwhite opened this issue Apr 10, 2018 · 7 comments

Comments

@jamesrwhite
Copy link

Unless I'm doing something wrong the pip dependencies don't seem to specified anywhere so it's not possible to simply run pip install iopipe and start using the library.

I can reproduce this like so (with pipenv):

  • Create a fresh virtual env pipenv --three
  • Install iopipe pip install iopipe
  • Run a test script that imports iopipe python -c 'import iopipe'

I get the following error as I don't have the six library installed:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/james/.local/share/virtualenvs/test-gXZ6kH7S/lib/python3.6/site-packages/iopipe/__init__.py", line 1, in <module>
    from .iopipe import IOpipe  # noqa
  File "/Users/james/.local/share/virtualenvs/test-gXZ6kH7S/lib/python3.6/site-packages/iopipe/iopipe.py", line 8, in <module>
    from .context import ContextWrapper
  File "/Users/james/.local/share/virtualenvs/test-gXZ6kH7S/lib/python3.6/site-packages/iopipe/context.py", line 4, in <module>
    from six import string_types
ModuleNotFoundError: No module named 'six'

I believe the six dependency and any others should be included in setup.py using install_requires?

kolanos added a commit to kolanos/iopipe-python that referenced this issue Apr 10, 2018
Closes iopipe#191

Signed-off-by: Michael Lavers <kolanos@gmail.com>
kolanos added a commit to kolanos/iopipe-python that referenced this issue Apr 10, 2018
Closes iopipe#191

Signed-off-by: Michael Lavers <kolanos@gmail.com>
kolanos added a commit that referenced this issue Apr 10, 2018
* Add a compat module, remove six dependency

Closes #191

Signed-off-by: Michael Lavers <kolanos@gmail.com>

* Up version for micro release

Signed-off-by: Michael Lavers <kolanos@gmail.com>
@pselle
Copy link
Contributor

pselle commented Apr 10, 2018

Thanks for the report! You're right, we're solving this by removing the dependency on six. In my opinion, it might've worked previously because of existing libraries in the environment. The next release will fix the issue.

@pselle
Copy link
Contributor

pselle commented Apr 10, 2018

@jamesrwhite You should be good to go with the 1.4.1 release. Thanks again for the report!

@jamesrwhite
Copy link
Author

jamesrwhite commented Apr 10, 2018

@pselle Thanks for replying so fast!

While that has fixed it for the six package it also looks like you depend on botocore and requests so this is still an issue. If it helps this is the error I'm now seeing:

$ python
Python 3.6.5 (default, Mar 30 2018, 06:41:53)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import iopipe
Traceback (most recent call last):
  File "/Users/james/.local/share/virtualenvs/ps_instruments-8fPwasxz/lib/python3.6/site-packages/iopipe/send_report.py", line 4, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/james/.local/share/virtualenvs/ps_instruments-8fPwasxz/lib/python3.6/site-packages/iopipe/__init__.py", line 1, in <module>
    from .iopipe import IOpipe  # noqa
  File "/Users/james/.local/share/virtualenvs/ps_instruments-8fPwasxz/lib/python3.6/site-packages/iopipe/iopipe.py", line 10, in <module>
    from .report import Report
  File "/Users/james/.local/share/virtualenvs/ps_instruments-8fPwasxz/lib/python3.6/site-packages/iopipe/report.py", line 12, in <module>
    from .send_report import send_report
  File "/Users/james/.local/share/virtualenvs/ps_instruments-8fPwasxz/lib/python3.6/site-packages/iopipe/send_report.py", line 6, in <module>
    from botocore.vendored import requests
ModuleNotFoundError: No module named 'botocore'

@pselle
Copy link
Contributor

pselle commented Apr 10, 2018

@jamesrwhite Yup, if you run locally, you'll need to have requests available, so this is expected. Snip:

From your project directory:

$ pip install iopipe -t .

# If running locally or in other environments _besides_ AWS Lambda:
$ pip install requests -t .

@jamesrwhite
Copy link
Author

Ah sorry, I didn't notice that in the README 🤦🏻‍♂️

@pselle
Copy link
Contributor

pselle commented Apr 10, 2018

No worries! We love the proactive reports 😄

@kolanos
Copy link
Contributor

kolanos commented Apr 10, 2018

@jamesrwhite We do it this way to keep iopipe as lightweight as possible. Since AWS Lambda provides requests as a part of botocore, we don't include requests as a install dependency. Keep that in mind when packaging your functions, too, as that could save you ~3.2MB.

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

No branches or pull requests

3 participants