packt-cli / Packt-Publishing-Free-Learning

Scripts that automatically claim and download free daily eBooks from https://www.packtpub.com/packt/offers/free-learning
MIT License
858 stars 185 forks source link

Exception occurred too many values to unpack (expected 1) #195

Closed Danielx303 closed 4 years ago

Danielx303 commented 4 years ago

C:\WINDOWS\system32>chdir C:\Packt-Publishing-Free-Learning

C:\Packt-Publishing-Free-Learning>packt-cli -gd [INFO] - Started solving ReCAPTCHA for https://www.packtpub.com/ website... [INFO] - Waiting for completion of the 702028762 task... [SUCCESS] - Solution found for 702028762 task. [INFO] - JWT token has been fetched successfully! [INFO] - Start grabbing ebook... [ERROR] - Exception occurred too many values to unpack (expected 1)

Press any key to continue . . .


Hi! I have this problem. Does somebody know what is wrong? I have this case for about 1-2 weeks.

mjenczmyk commented 4 years ago

Hi,

are you sure version 1.5.3 is installed ? @laurentlemercier has fixed this issue on current master - try to update the script with pip install packt -U.

Danielx303 commented 4 years ago

Hmmm... I've done what you said and it works! This is very strange to me...

This is my steps:

  1. one more time check version of my program - in the folder there is 1.5.3. Also, my 'github desktop' say that is 1.5.3.

  2. run "packt-cli -gd" - the same issue

  3. run "pip install packt -U"

this is the last lane from upgrading my packt:

Attempting uninstall: packt Found existing installation: packt 1.5.0 Uninstalling packt-1.5.0: Successfully uninstalled packt-1.5.0 Running setup.py install for packt ... done Successfully installed cachetools-4.1.1 click-7.1.1 google-api-core-1.21.0 google-api-python-client-1.8.0 google-auth-1.18.0 google-auth-httplib2-0.0.3 googleapis-common-protos-1.52.0 packt-1.5.3 protobuf-3.12.2 python-slugify-4.0.0 requests-2.23.0 text-unidecode-1.3

And... this is showing me that I had packt 1.5.0. Soo... What is the purpose of updating my version of the software by the program 'github desktop' as I eventually have to update it by command "pip install packt -U"

I'm ashamed that 'packt' doesn't work for me a second time, because I don't have updated software... I'm sorry about that. But this situation I don't understand what it's going on...

Regards and Thank you for your help! Daniel

mjenczmyk commented 4 years ago

I'm glad I could help ;) Sorry if I'm assuming below lesser extend of your knowledge about Python packaging that it really is.

The entire point of publishing this package on PyPi (which I was trying to do from the beginning) is that you don't need to copy any code, clone any repository or even have git or GitHub Desktop installed on your computer. Having Python installed and running pip install -U packt is enough to run the script - you don't have to update anything in GitHub Desktop unless you want to develop or contribute to the script.

There is another way, you can install the script from the source code in the repository - in that case you need to run pip install -e . while being in the repository directory after fetching fresh code from GitHub - but probably it's not the way you want it. It's useful when you want to try your changes after you change the code locally.