oduwsdl / archivenow

A Tool To Push Web Resources Into Web Archives
MIT License
403 stars 42 forks source link

ModuleNotFoundError: No module named '__init__' #18

Closed palewire closed 6 years ago

palewire commented 6 years ago

When installed on Heroku with pip here's the error I get.

from archivenow import archivenow

Triggers this:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/app/archive/management/commands/testis.py", line 10, in handle
    tasks.is_memento(clip.id)
  File "/app/.heroku/python/lib/python3.6/site-packages/celery/local.py", line 191, in __call__
    return self._get_current_object()(*a, **kw)
  File "/app/.heroku/python/lib/python3.6/site-packages/celery/app/task.py", line 380, in __call__
    return self.run(*args, **kwargs)
  File "/app/archive/tasks.py", line 13, in is_memento
    from archivenow import archivenow
  File "/app/.heroku/python/lib/python3.6/site-packages/archivenow/archivenow.py", line 10, in <module>
    from __init__ import __version__ as archiveNowVersion
ModuleNotFoundError: No module named '__init__'
maturban commented 6 years ago

I successfully deployed archivenow to heroku. I used the following two files:

"requirements.txt" which contains the following list of dependencies:

gunicorn
itsdangerous
Jinja2
MarkupSafe
Werkzeug
archivenow
requests

"Procfile" which contains the following line:

       ```web: archivenow --server --host 0.0.0.0 --port $PORT```

I noticed that 3 archives worked find. Archive.is did not accept "save" requests and responded with "409". Archive.is works fine if requests are sent from other places (e.g., my machine).

palewire commented 6 years ago

I believe archive.is has blocked requests from top cloud computing providers, which results in severely limiting what's possible.

That should be a separate ticket though.

As far as this matter, I would propose altering the import chain of this library so a simple import in a Python script works, as I tried above, so that starting the server isn't required.

On Mon, Nov 20, 2017, 3:33 AM Mohamed Aturban notifications@github.com wrote:

I successfully deployed archivenow to heroku. I used the following two files:

"requirements.txt" which contains the following list of dependencies:

gunicorn itsdangerous Jinja2 MarkupSafe Werkzeug archivenow requests

"Procfile" which contains the following line:

   ```web: archivenow --server --host 0.0.0.0 --port $PORT```

I noticed that 3 archives worked find. Archive.is did not accept "save" requests and responded with "409". Archive.is works fine if requests are sent from other places (e.g., my machine).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/oduwsdl/archivenow/issues/18#issuecomment-345669984, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAnCbrgUOUS8rEFKOwvQJiTSYNlpDh4ks5s4WOJgaJpZM4Qf9Tm .