Comments (12)
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.
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.
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.
Nope, no change, you still shouldn't put future imports in the script.
from stickytape.
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.
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.
Make sure you're using Python 3, and delete the line:
from __future__ import unicode_literals
from stickytape.
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.
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.
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.
@mwilliamson
I guess you fixed this issue too? I do not see it any more.
from stickytape.
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)
- Library to script conversion possible? HOT 4
- Dynamic imports don't work if the python path is a level up from their location HOT 2
- PermissionError: [WinError 5] Access is denied Error in Windows environment HOT 3
- How to "make" HOT 2
- Holding of the __init__.py during 'make_package' cause failure on exit (Windows + IronPython)
- Using sticky tape to pass code to external engine HOT 1
- Output file still want to import files HOT 20
- Relative imports matching stdlib modules are incorrectly ignored HOT 1
- Improve list of stdlib modules
- Handle relative imports from parent packages HOT 1
- UnicodeEncodeError: 'charmap' codec can't encode characters in position 83853-83854 HOT 13
- Relative import still doesn't work? HOT 4
- SyntaxError: Non-UTF-8 code starting with '\xff' HOT 1
- How to include Python standard library HOT 1
- Renaming of modules HOT 4
- Explicitly add modules inline HOT 1
- Move future statements at the top HOT 2
- how to convert many py files to a py file without make tempfile HOT 1
- when i exec a cmpiled file in a cmpiled file ,raise NameError: global name '__stickytape_working_dir' is not defined HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stickytape.