question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Output file still want to import files

See original GitHub issue

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:

`stickytape %mypar%/youtube_dl/mytest.py --add-python-path . --output-file st-temp.py`

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):

from future import unicode_literals

import sys

import os.path path = os.path.realpath(os.path.abspath(file)) sys.path.insert(0, os.path.dirname(os.path.dirname(path)))

import youtube_dl

if name == ‘main’: sys.argv = [sys.argv[0], “-g”, “https://www.youtube.com/watch?v=N5xyr1_DhpA” ] youtube_dl.main()

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.)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
mwilliamsoncommented, Jan 27, 2021

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

1reaction
mwilliamsoncommented, Jan 24, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Import or link to data in a text file - Microsoft Support
To use a text file as a source file for importing or linking, the contents of the file must be organized in such...
Read more >
6 Common CSV Import Errors and How to Fix Them - Flatfile
One of the most common CSV import errors is that the file is simply too large. That can be caused by too many...
Read more >
Import, Export, and Convert Data Files
Data Import​​ rio allows you to import files in almost any format using one, typically single-argument, function. import() infers the file format ...
Read more >
Import and export from the command-line - Access to Memory
The --output option will generate a simple CSV file containing details of the import process, including the time elapsed and memory used during...
Read more >
Import files into InDesign from other applications
Don't place layers in nested layer sets if you want to adjust layers in InDesign. In Illustrator, choose File > Save As.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found