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 'pytz' when following demo instructions. #779

Closed
gaurav opened this issue Feb 28, 2023 · 3 comments
Closed

Comments

@gaurav
Copy link

gaurav commented Feb 28, 2023

I tried to follow the instructions at https://atramhasis.readthedocs.io/en/latest/demo.html with Python 3.9, I ran into the following errors both on running dump_rdf development.ini and on running pserve development.ini:

Traceback (most recent call last):
  File "/Users/gaurav/Development/opensource/atramhasis/venv/bin/dump_rdf", line 8, in <module>
    sys.exit(main())
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/atramhasis/scripts/dump_rdf.py", line 49, in main
    env = bootstrap(config_uri)
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/pyramid/paster.py", line 117, in bootstrap
    app = get_app(config_uri, options=options)
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/pyramid/paster.py", line 30, in get_app
    return loader.get_wsgi_app(name, options)
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/plaster_pastedeploy/__init__.py", line 111, in get_wsgi_app
    return loadapp(
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/paste/deploy/loadwsgi.py", line 248, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/paste/deploy/loadwsgi.py", line 273, in loadobj
    return context.create()
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/paste/deploy/loadwsgi.py", line 741, in create
    return self.object_type.invoke(self)
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/paste/deploy/loadwsgi.py", line 138, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/paste/deploy/util.py", line 61, in fix_call
    val = callable(*args, **kw)
  File "/Users/gaurav/Development/opensource/atramhasis/atramhasis_demo/atramhasis_demo/__init__.py", line 38, in main
    config.include("atramhasis")
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/pyramid/config/__init__.py", line 666, in include
    c(configurator)
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/atramhasis/__init__.py", line 24, in includeme
    config.scan()
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/pyramid/config/__init__.py", line 880, in scan
    scanner.scan(
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/venusian/__init__.py", line 220, in scan
    __import__(modname)
  File "/Users/gaurav/Development/opensource/atramhasis/venv/lib/python3.9/site-packages/atramhasis/scripts/delete_scheme.py", line 7, in <module>
    from pytz import timezone
ModuleNotFoundError: No module named 'pytz'

On installing this package manually using pip install pytz, both those commands work without any problem. I'm guessing pytz has been accidentally left out of a requirements file somewhere?

@koenedaele
Copy link
Member

Last time I edited the demo instructions I had no issues (Ubuntu Linux). I just checked and pytz is present in that venv. Is it possible you're using MacOSX (based on the home dir locations) and this issue is OS related?

@koenedaele
Copy link
Member

pytz should come installed with Babel, but apparently it isn't. There's actually no reason for pytz to be in that delete_scheme script, so it can be removed there. It does have a use in the create_sitemap script, where it seems we've hardcoded the timezone to ours, so that could be done better.

@koenedaele
Copy link
Member

Pytz is no longer needed anywhere.

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