Skip to content

Unable to run time.py and number.py  #140

@marostelka

Description

@marostelka

What did you do?

I tried to run time.py and number.py but they failed.

What did you expect to happen?

Both time.py and number.py have shebangs so I expected they are runnable.

What actually happened?

Traceback (most recent call last):
  File "/tmp/humanize/src/humanize/time.py", line 17, in <module>
    from .i18n import _gettext as _
ImportError: attempted relative import with no known parent package

and

Traceback (most recent call last):
  File "/tmp/humanize/src/humanize/./number.py", line 12, in <module>
    from .i18n import _gettext as _
ImportError: attempted relative import with no known parent package

What versions are you using?

  • OS: Ubuntu 22.04.3 LTS
  • Python: Python 3.9.17
  • Humanize: main branch from git

Please include code that reproduces the issue.

git clone https://github.com/python-humanize/humanize.git
cd humanize/src/humanize/

chmod +x time.py
./time.py
# and
chmod +x number.py
./number.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions