Giter Site home page Giter Site logo

Comments (20)

mwilliamson avatar mwilliamson commented on July 4, 2024 1

This is likely because you're modifying sys.path as part your script, so stickytape won't be able to find youtube_dl (assuming it's not otherwise on your Python path). As a general rule in Python programming, I'd suggest avoid directly manipulating sys.path in a script. Stickytape supports adding specific paths to the Python path using the --add-python-path argument, as documented in the README.

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024 1

I think I have given you all the info needed to reproduce it. Could you please tell me what you are missing?

I don't think you've shared the code that you're trying to use stickytape on. If you could share that code, and the command you're using, then that would help.

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024 1

Could you post the code that you're using? You posted some code in the original issue, but later said that you'd changed it, so I don't know what code you're using now. Also, could you post the command you're using?

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024 1

It looks like there's a few different imports in youtube-dl that stickytape doesn't handle correctly. I'll take a look at fixing them if I get a chance, but I don't know when that will be.

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024 1

This is just a spare time project for me, so I wouldn't hold your breath! Depending on your use-case, you might well be better off using something else: for instance, using PyInstaller, or using the single-file youtube-dl download.

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024 1

The latest version of stickytape resolves at least some of the issues in using youtube-dl. I haven't tried your specific example though.

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

@mwilliamson Thanks. I changed to that. (Maybe mention this in the docs?)

Now I get much more complicated errors. I think I will look at them and see if I understand anything. And probably file a new bug report.

(If you prefer I can give more detailed instructions here. So you do not have to wait for my probably slow analysis.)

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024

Closing for now, but feel free to reopen if you find any issues.

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

Thanks, but please reopen. I can't get this to work. (I did send you a mail message a few days ago where I told you this and asked for some help.)

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024

Could you describe the problem you're having?

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

As I said I normally do not explicitly use python. So my setup of python might be broken. I really do not know.

To investigate this I switched from using Windows 10 cmd shell to the Ubuntu subsystem that now comes with Windows 10. I normally do not use Ubuntu (or any Linux-variant) so I struggled a bit with the setup again. After consulting my friend Internet I think I finally got the setup complete by using

sudo apt-get update and sudo apt-get dist-upgrade

A surprisingly 300 MB update.

After moving from __future__ import unicode_literals to the top of the stickytape output I now get the error below. (There may be something wrong with PYTHONPATH. I get a bit lost here.)

`# python b.py
Traceback (most recent call last):
File "/tmp/tmpqc6wj4gm/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/tmpqc6wj4gm/youtube_dl/init.py", line 43, in
from .extractor import gen_extractors, list_extractors
File "/tmp/tmpqc6wj4gm/youtube_dl/extractor/init.py", line 9, in
import io
File "/tmp/tmpqc6wj4gm/youtube_dl/extractor/extractors.py", line 4, in
ModuleNotFoundError: No module named 'youtube_dl.extractor.abc'`

from stickytape.

mwilliamson avatar mwilliamson commented on July 4, 2024

I'm afraid I can't help without being able to see the source code, or other ways of reproducing the error. If you could provide minimal reproduction steps, then I'll take a look if I get a chance.

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

I think I have given you all the info needed to reproduce it. Could you please tell me what you are missing?

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

The code I want to use stickytape on is in the repository below. (With the small addition I mentioned in the beginning.)

https://github.com/ytdl-org/youtube-dl

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

youtube-dl/youtube_dl/mytest.py:

##### Copied from __main__.py

from __future__ import unicode_literals
import sys
import youtube_dl

if __name__ == '__main__':
    print()
    print(f"Arguments count: {len(sys.argv)}")
    for i, arg in enumerate(sys.argv):
        print(f"Argument {i:>6}: {arg}")
    sys.argv = [sys.argv[0], "-g", "https://www.youtube.com/watch?v=N5xyr1_DhpA" ]
    youtube_dl.main()

In youtube_dl:
stickytape mytest.py --add-python-path .. --output-file b.py

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

Please reopen. This is a blocking issue for me.

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

It looks like there's a few different imports in youtube-dl that stickytape doesn't handle correctly. I'll take a look at fixing them if I get a chance, but I don't know when that will be.

That sounds very good. It looks a bit complicated.

I am trying to help to solve some accessibility issues with this. It has been on my to-do list for long. And I hoped that this could be a way. So I am looking forward to your replies.

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

I need a single python file. And it should be as small as possible. I don't believe there is something like it from youtube-dl. (I need to import this to Brython.)

If you have some thoughts about what goes wrong I can perhaps look into it.

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

Thanks, that sounds very nice. I will have a look as soon as I can.

from stickytape.

lborgman avatar lborgman commented on July 4, 2024

Many thanks! I took a deep breath, updated python to 3.9, updated stickytape. It did not work in Windows 10 cmd shell.

Took a much deeper breath, updated Windows WSL, updated Ubuntu for WSL to 21.04, updated its python to 3.9, etc.

The output file worked (in Ubuntu bash).

This was a very essential step in what I am trying to do. Now over to the people at Brython to get some advice there.

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.