jessecooper / pyetrade

Python E-Trade API Wrapper
GNU General Public License v3.0
207 stars 98 forks source link

ModuleNotFound during pip install #39

Closed jaypatel24 closed 2 years ago

jaypatel24 commented 3 years ago

When installing with pip, the requirements for pyetrade are not automatically downloaded.

If I manually install them before installing pyetrade (e.g. pip install requests_oauthlib) , then installation succeeds.

How can we get the dependencies to automatically be installed first when running pip install pyetrade?

$ pip install pyetrade                                                                                                                                                           [14:15:43]
Collecting pyetrade
  Using cached pyetrade-1.2.1.tar.gz (10 kB)
    ERROR: Command errored out with exit status 1:
     command: /private/tmp/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ts/z2m10kg55q1gj22m9sbl4x5m0000gn/T/pip-install-639_mm9p/pyetrade/setup.py'"'"'; __file__='"'"'/private/var/folders/ts/z2m10kg55q1gj22m9sbl4x5m0000gn/T/pip-install-639_mm9p/pyetrade/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/ts/z2m10kg55q1gj22m9sbl4x5m0000gn/T/pip-pip-egg-info-em8699_b
         cwd: /private/var/folders/ts/z2m10kg55q1gj22m9sbl4x5m0000gn/T/pip-install-639_mm9p/pyetrade/
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/ts/z2m10kg55q1gj22m9sbl4x5m0000gn/T/pip-install-639_mm9p/pyetrade/setup.py", line 4, in <module>
        from pyetrade import __version__
      File "/private/var/folders/ts/z2m10kg55q1gj22m9sbl4x5m0000gn/T/pip-install-639_mm9p/pyetrade/pyetrade/__init__.py", line 9, in <module>
        from . import authorization  # noqa: F401
      File "/private/var/folders/ts/z2m10kg55q1gj22m9sbl4x5m0000gn/T/pip-install-639_mm9p/pyetrade/pyetrade/authorization.py", line 10, in <module>
        from requests_oauthlib import OAuth1Session
    ModuleNotFoundError: No module named 'requests_oauthlib'
jaypatel24 commented 3 years ago

Changing the version to not import from pyetrade solved this for me.

https://github.com/jaypatel24/pyetrade/commit/6d92003f751f351198d6690d0a111939c5778ca1

Are we okay hardcoding it in setup.py? I've also seen other projects use a __version__.py file.

ceeeeej commented 3 years ago

In my case I had to run both: pip install xmltodict pip install jxmlease

This was with a conda env and python 3.8.5

jessecooper commented 2 years ago

fixed in v1.3.5 sorry about the delay in fixing this.