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

ModuleNotFoundError: No module named 'tzlocal' on dependency "mpu" #26

Closed
saskenuba opened this issue Oct 14, 2020 · 2 comments
Closed

Comments

@saskenuba
Copy link

Hello! A fresh install with poetry (python package manager) is giving an error of ModuleNotFoundError when the function cfg.load() is called.

Somehow the module tzlocal is not getting installed?
Is this with how cfg_load declares its deps? or is it on the mpu dep side?

Trace:

Traceback (most recent call last):
  File "/home/martin/Documentos/Programming/Python/Projetos/test-project/test_project/__init__.py", line 6, in <module>
    cfg.load("/home/martin/Documentos/Programming/Python/Projetos/steam-api-explore/cfg-template.yaml")
  File "/home/martin/Documentos/PythonEnvironments/steam-api-explore-oyX2e_1N-py3.8/lib/python3.8/site-packages/cfg_load/__init__.py", line 66, in load
    meta = mpu.io.get_file_meta(filepath)
  File "/home/martin/Documentos/PythonEnvironments/steam-api-explore-oyX2e_1N-py3.8/lib/python3.8/site-packages/mpu/io.py", line 366, in get_file_meta
    meta["last_access_datetime"] = get_access_datetime(filepath)
  File "/home/martin/Documentos/PythonEnvironments/steam-api-explore-oyX2e_1N-py3.8/lib/python3.8/site-packages/mpu/io.py", line 344, in get_access_datetime
    import tzlocal
ModuleNotFoundError: No module named 'tzlocal'

I have included a minimal pyproject for you to test.

pyproject.toml

[tool.poetry]
name = "test-project"
version = "0.1.0"
description = ""
authors = ["Martin <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.8"
cfg-load = "*"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

Sample file:

__version__ = '0.1.0'

import cfg_load as cfg

if __name__ == '__main__':
    cfg.load("/home/martin/Documentos/Programming/Python/Projetos/steam-api-explore/cfg-template.yaml")
@saskenuba
Copy link
Author

This is caused by python-poetry/poetry#2545, and the fix works correctly. Sorry for the incovenience.

@MartinThoma
Copy link
Owner

No problem :-) I was just about to have a look at it - thank you for coming back and letting me know 🤗

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

2 participants