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

Import expects deps installed before they are installed #245

Open
vsoch opened this issue Apr 24, 2022 · 0 comments
Open

Import expects deps installed before they are installed #245

vsoch opened this issue Apr 24, 2022 · 0 comments

Comments

@vsoch
Copy link

vsoch commented Apr 24, 2022

Hiya! When you do this import:

from pyDeltaRCM import shared_tools

You are technically importing your module before you've installed it, so all the dependencies are expected to be there:

       File "/tmp/tmp9e8wd_fn/pyDeltaRCM/pyDeltaRCM/__init__.py", line 1, in <module>
          from .model import DeltaModel
        File "/tmp/tmp9e8wd_fn/pyDeltaRCM/pyDeltaRCM/model.py", line 7, in <module>
          from .iteration_tools import iteration_tools
        File "/tmp/tmp9e8wd_fn/pyDeltaRCM/pyDeltaRCM/iteration_tools.py", line 7, in <module>
          import matplotlib.pyplot as plt

If you just need the version:

version=shared_tools._get_version(),

perhaps you could just read it statically from a file? Or some other means? There are ways to install specific modules before running your main setup, e.g.,

from setuptools import dist
dist.Distribution().fetch_build_eggs(['numpy>=1.10'])

But I don't think this applies here because you are trying to use the shared_tools in your module, and thus import everything.

@vsoch vsoch changed the title Import expects matplotlib Import expects deps installed before they are installed Apr 24, 2022
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

1 participant