-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output file still want to import files #20
Comments
This is likely because you're modifying |
@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.) |
Closing for now, but feel free to reopen if you find any issues. |
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.) |
Could you describe the problem you're having? |
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
A surprisingly 300 MB update. After moving `# python b.py During handling of the above exception, another exception occurred: Traceback (most recent call last): |
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. |
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. |
The code I want to use stickytape on is in the repository below. (With the small addition I mentioned in the beginning.) |
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? |
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: |
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. |
Please reopen. This is a blocking issue for me. |
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. |
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. |
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. |
The latest version of stickytape resolves at least some of the issues in using youtube-dl. I haven't tried your specific example though. |
Thanks, that sounds very nice. I will have a look as soon as I can. |
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. |
Please notice that I do not normally use python! So I do not know the import system at all.
I tried to make a single python file for a youtube-dl case:
The output file works in the same directory where it is written. But it still imports other files (which I to my surprise noticed when I tried to move it).
The file mytest.py looks like this (this file is mostly just copied from main.py):
It is
import youtube-dl
that is the still there. (And that is of course just a start of the imports I want to avoid.)(There is another problem too. The
from __future__ import unicode_literals
does not work. Moving it to the top of the output file fixes this problem.)The text was updated successfully, but these errors were encountered: