kemayo / leech

Turn a story on certain websites into an ebook for convenient reading
MIT License
158 stars 24 forks source link

Error on trying to download an Ebook #61

Closed Lithrandil2 closed 3 years ago

Lithrandil2 commented 3 years ago

Errormessage + proof that everything is up to date and all dependencies are there:

E:\Download\leech-master>pip install poetry
Requirement already satisfied: poetry in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (1.1.5)
Requirement already satisfied: clikit<0.7.0,>=0.6.2 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (0.6.2)
Requirement already satisfied: pkginfo<2.0,>=1.4 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (1.6.1)
Requirement already satisfied: poetry-core<1.1.0,>=1.0.2 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (1.0.2)
Requirement already satisfied: html5lib<2.0,>=1.0 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (1.1)
Requirement already satisfied: requests<3.0,>=2.18 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (2.25.1)
Requirement already satisfied: pexpect<5.0.0,>=4.7.0 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (4.8.0)
Requirement already satisfied: cachy<0.4.0,>=0.3.0 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (0.3.0)
Requirement already satisfied: tomlkit<1.0.0,>=0.7.0 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (0.7.0)
Requirement already satisfied: packaging<21.0,>=20.4 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (20.8)
Requirement already satisfied: keyring<22.0.0,>=21.2.0 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (21.6.0)
Requirement already satisfied: shellingham<2.0,>=1.1 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (1.3.2)
Requirement already satisfied: cachecontrol[filecache]<0.13.0,>=0.12.4 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (0.12.6)
Requirement already satisfied: crashtest<0.4.0,>=0.3.0 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (0.3.1)
Requirement already satisfied: cleo<0.9.0,>=0.8.1 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (0.8.1)
Requirement already satisfied: virtualenv<21.0.0,>=20.0.26 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (20.2.2)
Requirement already satisfied: requests-toolbelt<0.10.0,>=0.9.1 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from poetry) (0.9.1)
Requirement already satisfied: msgpack>=0.5.2 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from cachecontrol[filecache]<0.13.0,>=0.12.4->poetry) (1.0.2)
Requirement already satisfied: lockfile>=0.9 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from cachecontrol[filecache]<0.13.0,>=0.12.4->poetry) (0.12.2)
Requirement already satisfied: pastel<0.3.0,>=0.2.0 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from clikit<0.7.0,>=0.6.2->poetry) (0.2.1)
Requirement already satisfied: pylev<2.0,>=1.3 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from clikit<0.7.0,>=0.6.2->poetry) (1.3.0)
Requirement already satisfied: webencodings in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from html5lib<2.0,>=1.0->poetry) (0.5.1)
Requirement already satisfied: six>=1.9 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from html5lib<2.0,>=1.0->poetry) (1.15.0)
Requirement already satisfied: pywin32-ctypes!=0.1.0,!=0.1.1 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from keyring<22.0.0,>=21.2.0->poetry) (0.2.0)
Requirement already satisfied: pyparsing>=2.0.2 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from packaging<21.0,>=20.4->poetry) (2.4.7)
Requirement already satisfied: ptyprocess>=0.5 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from pexpect<5.0.0,>=4.7.0->poetry) (0.6.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0,>=2.18->poetry) (1.26.2)
Requirement already satisfied: idna<3,>=2.5 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0,>=2.18->poetry) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0,>=2.18->poetry) (4.0.0)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0,>=2.18->poetry) (2020.12.5)
Requirement already satisfied: appdirs<2,>=1.4.3 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from virtualenv<21.0.0,>=20.0.26->poetry) (1.4.4)
Requirement already satisfied: filelock<4,>=3.0.0 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from virtualenv<21.0.0,>=20.0.26->poetry) (3.0.12)
Requirement already satisfied: distlib<1,>=0.3.1 in c:\users\lithrandil2\appdata\local\programs\python\python39\lib\site-packages (from virtualenv<21.0.0,>=20.0.26->poetry) (0.3.1)

E:\Download\leech-master>poetry install
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: leech (1.0.0)

E:\Download\leech-master>poetry shell
Spawning shell within C:\Users\Lithrandil2\AppData\Local\pypoetry\Cache\virtualenvs\leech-qMXsE8nv-py3.9
Microsoft Windows [Version 10.0.19042.867]
(c) 2020 Microsoft Corporation. All rights reserved.

E:\Download\leech-master>leech.py https://www.royalroad.com/fiction/39850/the-dark-lords-home-for-undead-heroes
Traceback (most recent call last):
  File "E:\Download\leech-master\leech.py", line 13, in <module>
    import sites
  File "E:\Download\leech-master\sites\__init__.py", line 10, in <module>
    import attr
ModuleNotFoundError: No module named 'attr'

E:\Download\leech-master>
kemayo commented 3 years ago

Not sure what's going on there. There's two major options:

  1. poetry has failed to install attrs, despite claiming that there are no dependencies to install.
  2. poetry shell isn't dropping you into a correctly configured environment (i.e. it did install attrs, but it's not accessible)

Might be worth running poetry show and seeing what it thinks is installed. For me, I see this:

(leech--rZNhJ8c-py3.9)  ◰³ leech--rZNhJ8c-py3.9  ~/s/leech   $  poetry show          4165ms  Sun Apr  4 01:39:53 2021
attrs               20.3.0    Classes Without Boilerplate
beautifulsoup4      4.9.3     Screen-scraping library
certifi             2020.12.5 Python package for providing Mozilla's CA Bundle.
chardet             4.0.0     Universal encoding detector for Python 2 and 3
click               7.1.2     Composable command line interface toolkit
click-default-group 1.2.2     Extends click.Group to invoke a command without explicit subcommand name
flake8              3.8.4     the modular source code checker: pep8 pyflakes and co
html5lib            1.1       HTML parser based on the WHATWG HTML specification
idna                2.10      Internationalized Domain Names in Applications (IDNA)
mccabe              0.6.1     McCabe checker, plugin for flake8
pillow              8.1.0     Python Imaging Library (Fork)
pycodestyle         2.6.0     Python style guide checker
pyflakes            2.2.0     passive checker of Python programs
requests            2.25.1    Python HTTP for Humans.
requests-cache      0.5.2     Persistent cache for requests library
six                 1.15.0    Python 2 and 3 compatibility utilities
soupsieve           2.1       A modern CSS selector implementation for Beautiful Soup.
urllib3             1.26.2    HTTP library with thread-safe connection pooling, file post, and more.
webencodings        0.5.1     Character encoding aliases for legacy web content
Lithrandil2 commented 3 years ago

Hmmm using poetry show gives me the same output:

E:\Download\leech-master>poetry show
attrs               20.3.0    Classes Without Boilerplate
beautifulsoup4      4.9.3     Screen-scraping library
certifi             2020.12.5 Python package for providing Mozilla's CA Bundle.
chardet             4.0.0     Universal encoding detector for Python 2 and 3
click               7.1.2     Composable command line interface toolkit
click-default-group 1.2.2     Extends click.Group to invoke a command without explicit subcommand name
flake8              3.8.4     the modular source code checker: pep8 pyflakes and co
html5lib            1.1       HTML parser based on the WHATWG HTML specification
idna                2.10      Internationalized Domain Names in Applications (IDNA)
mccabe              0.6.1     McCabe checker, plugin for flake8
pillow              8.1.0     Python Imaging Library (Fork)
pycodestyle         2.6.0     Python style guide checker
pyflakes            2.2.0     passive checker of Python programs
requests            2.25.1    Python HTTP for Humans.
requests-cache      0.5.2     Persistent cache for requests library
six                 1.15.0    Python 2 and 3 compatibility utilities
soupsieve           2.1       A modern CSS selector implementation for Beautiful Soup.
urllib3             1.26.2    HTTP library with thread-safe connection pooling, file post, and more.
webencodings        0.5.1     Character encoding aliases for legacy web content

But the problem still persists.

kemayo commented 3 years ago

Let's see... if you instead run it with poetry run leech do you get any different result?

Lithrandil2 commented 3 years ago

Yes that did it. Thank you. Still pretty weird though.

kemayo commented 3 years ago

Yeah. I have to assume it's something going wrong with poetry shell-on-windows, somehow.