question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setup.py is trying to import dependencies which aren't yet installed

See original GitHub issue

In this recent change (https://github.com/crsmithdev/arrow/commit/2e5031b473bcf10b99b9d7ff8a7e72499c412c07), setup.py now does from arrow import __version__ which triggers a bunch of other imports. This fails if python-dateutil hasn’t already been installed.

Collecting arrow<1,>=0 (from this-is-redacted==1.2.3->also-redacted==4.5.6)
  Downloading https://files.pythonhosted.org/packages/a0/3b/0b5c7771a619ee4eae1f894669dd5f7c0aae9c92d87891c4c746937f9cc4/arrow-0.14.0.tar.gz (102kB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-c5xbxqxi/arrow/setup.py", line 4, in <module>
        from arrow import __version__
      File "/tmp/pip-build-c5xbxqxi/arrow/arrow/__init__.py", line 3, in <module>
        from .api import get, now, utcnow
      File "/tmp/pip-build-c5xbxqxi/arrow/arrow/api.py", line 10, in <module>
        from arrow.factory import ArrowFactory
      File "/tmp/pip-build-c5xbxqxi/arrow/arrow/factory.py", line 15, in <module>
        from dateutil import tz as dateutil_tz
    ImportError: No module named 'dateutil'

It looks like this issue has come up previously https://github.com/crsmithdev/arrow/issues/120

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
andrewmwilsoncommented, Jun 4, 2019

Thanks again for the quick fix 👏 👏 👏

0reactions
andrewmwilsoncommented, Jun 4, 2019

Sorry, referenced wrong issue ⬆️

Read more comments on GitHub >

github_iconTop Results From Across the Web

python import error from setup.py if dependencies are not ...
I would like to keep same usage and keep structure but solve the import problem during setup if the dependent module was not...
Read more >
Path dependencies with setup.py cannot be installed ... - GitHub
The setup() in setup.py is a placeholder and the script does not get executed to setup(). It erred out at line 2 when...
Read more >
A Practical Guide to Using Setup.py - GoDataDriven
Requirements. dependencies in the install_requires argument. requirements will automatically be installed by pip when you install your package.
Read more >
Dependencies Management in Setuptools
Setuptools allows you to declare dependencies that are not installed by default. This effectively means that you can create a “variant” of your...
Read more >
requirements.txt vs setup.py in Python - Towards Data Science
Once you install all the dependencies, you can see the precise version of each dependency installed in the virtual environment by running pip ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found