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

Install in virtualenv fails if pandas is not installed #20

Closed
jbrockmendel opened this issue Jul 16, 2017 · 4 comments
Closed

Install in virtualenv fails if pandas is not installed #20

jbrockmendel opened this issue Jul 16, 2017 · 4 comments
Labels

Comments

@jbrockmendel
Copy link

Putting both pandas and fredapi in a "requirements.txt" file and then installing in a fresh virtualenv leads to:

Collecting fredapi (from -r requirements.txt (line 15))
  Using cached fredapi-0.4.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ej66i5se/fredapi/setup.py", line 3, in <module>
        from fredapi.version import version as __version__
      File "/tmp/pip-build-ej66i5se/fredapi/fredapi/__init__.py", line 3, in <module>
        from fredapi.fred import Fred
      File "/tmp/pip-build-ej66i5se/fredapi/fredapi/fred.py", line 14, in <module>
        import pandas as pd
    ImportError: No module named 'pandas'

Can the version.py file go outside the fredapi directory?

@sandrotosi
Copy link

yes please fix this! reason is that fredapi.init has from fredapi.fred import Fred which means fred needs to be importable, which is not since pandas is not available.

i think several other projects solve the same situation in a way that allows setup.py to get the project's version without requiring for the whole module to be importable at such an early stage of the virtualenv creation

@mortada mortada added the bug label Aug 30, 2017
@mortada
Copy link
Owner

mortada commented Sep 2, 2017

thanks for reporting this, I don't use virtualenv so didn't realize this problem, I think the problem is that setup.py is importing fredapi.version.py which in turn loads fredapi/__init__.py and that leads to the dependency requirement.

I will push a fix today

@mortada mortada closed this as completed in 1551f4e Sep 2, 2017
@mortada
Copy link
Owner

mortada commented Sep 3, 2017

Please check if the latest release 0.4.1 https://github.com/mortada/fredapi/releases/tag/v0.4.1 fixes this issue for you. Thanks!

@sandrotosi
Copy link

yup that worked just fine, thanks!!!

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

No branches or pull requests

3 participants