rajatomar788 / pywebcopy

Locally saves webpages to your hard disk with images, css, js & links as is.
https://rajatomar788.github.io/pywebcopy/
Other
527 stars 106 forks source link

ImportError: cannot import name UserDict #40

Closed Z-Zen closed 4 years ago

Z-Zen commented 4 years ago

I encountered an issue today while trying to import pywebcopy. This is related to the closed issue . I tried to install via pip and also building it manually by cloning from github.

Traceback (most recent call last):
  File "test_untitled2.py", line 13, in <module>
    from pywebcopy import save_webpage
  File "/usr/local/lib/python2.7/dist-packages/pywebcopy/__init__.py", line 49, in <module>
    from .configs import config, SESSION
  File "/usr/local/lib/python2.7/dist-packages/pywebcopy/configs.py", line 13, in <module>
    from collections import UserDict
ImportError: cannot import name UserDict

Any idea what could be the problem ?

Thanks in advance.

rajatomar788 commented 4 years ago

The UserDict is not available in python2. It is fixed on the repo but not released on pypi. It is now imported from six on the github version.

rajatomar788 commented 4 years ago

New version 6.2.0 is now released on pypi. Install it using pip:

$ pip install pywebcopy==6.2.0

If you still have any problems then reopen this issue.