Giter Site home page Giter Site logo

Comments (12)

mwilliamson avatar mwilliamson commented on July 4, 2024 1

If you're on Python 3, importing unicode_literals has no effect, so I'd suggest just getting rid of the import.

If you're on Python 2, I'd suggest using Python 3!

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024 1

Based on the code you posted, the issue is the import in the script you write, not in the modules that are imported (which, if memory serves, are copied verbatim, so should still have any future imports at the top).

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024 1

That's a different error from the original error. The original error is:

 from __future__ import unicode_literals
    ^
SyntaxError: from __future__ imports must occur at the beginning of the file

The new error is:

ModuleNotFoundError: No module named 'youtube_dl.extractor.abc'"

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024 1

Nope, no change, you still shouldn't put future imports in the script.

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

The python code is not mine. It is from youtube-dl. I guess they have reasons not to remove the import yet.

May I suggest that you just comment those lines out when you produce the output code with stickytape? (I am not sure, but I think there are quite a few of those lines in youtube-dl.)

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

Thanks. I have no idea what I am doing wrong there. Can you please tell me?

Please notice that python mytest.py works as expected.

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024

Make sure you're using Python 3, and delete the line:

from __future__ import unicode_literals

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

I just did that (python 3.8.0). It did not work. The error is essentially the same as before:

"# python b.py
Traceback (most recent call last):
File "/tmp/tmpnaxiw3gz/youtube_dl/extractor/init.py", line 4, in
from future import unicode_literals
ModuleNotFoundError: No module named 'youtube_dl.extractor.lazy_extractors'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "b.py", line 1640, in
import youtube_dl
File "/tmp/tmpnaxiw3gz/youtube_dl/init.py", line 43, in
from .extractor import gen_extractors, list_extractors
File "/tmp/tmpnaxiw3gz/youtube_dl/extractor/init.py", line 9, in
import io
File "/tmp/tmpnaxiw3gz/youtube_dl/extractor/extractors.py", line 4, in
ModuleNotFoundError: No module named 'youtube_dl.extractor.abc'"

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

Eh, sorry. Wrong issue. I thought you were commenting on the main issue (20) that I reported.

(Of course I can just remove that line from my code. But that does not help at all.)

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

Perhaps I should say that this issue is not a fatal blocking issue for me. Since you mentioned that the line does not do anything useful in python3 I can just postprocess the output. But anyway it would be very convenient if you did that processing in stickytape (so other people do not stumble on this issue if they try stickytape).

However issue 20 is a fatal blocking issue for me.

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

@mwilliamson
I guess you fixed this issue too? I do not see it any more.

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

Oh, thanks, I see. I initially copied it from main.py and commented it out when you said it was not needed. I forgot I did that. And I thought there were more of those in the youtube-dl code since it appeared way down in the stickytape output.

Then I close this.

from stickytape.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.