Skip to content
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

Python27 using youtube-dl.exe in Win7 #3065

Closed
happyraver1958 opened this issue Jun 11, 2014 · 10 comments
Closed

Python27 using youtube-dl.exe in Win7 #3065

happyraver1958 opened this issue Jun 11, 2014 · 10 comments

Comments

@happyraver1958
Copy link

I'm running youtube-dl.exe in my \windows\system32 directory from my home folder\downloads. I'm using Python 3.4.1. When I run something like "youtube-dl https://www.youtube.com/watch?v=eoXY7LSy_ZY" it comes back with:

Traceback (most recent call last):
File "C:\Python27\lib\site-packages\py2exe\boot_common.py", line 92, in
ImportError: No module named linecache
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named zipextimporter
Traceback (most recent call last):
File "main.py", line 15, in
ImportError: No module named youtube_dl

Why is it defaulting to Python27? Where can I specify that I'm not using Python 2.7? The directory listed in the message doesn't exist, my Python directory is C:\Python34.
I ran searches for support and I have found nothing even similar to this.
I believe I am doing something so stupid that nobody else has even thought of doing and that's probably why it's happening, but I'm a newbie and I haven't figured out what I'm doing wrong yet.
Any help is greatly appreciated.

@phihag
Copy link
Contributor

phihag commented Jun 11, 2014

This error is really weird, but not for the reason you think it is. There are three ways to run youtube-dl:

You've picked the third option, so your version of youtube-dl should work on any system. However, it fails to load initially, and that's the weird part. I would very much like to reproduce this problem. Can you try moving youtube-dl to the current directory and re-running it? C:\Windows\System32 is pretty much mapped through all kinds of compatibility layers, so it may not be the best directory to place an executable in.

If the error persists with youtube-dl in the current directory, can you give me the following information?

  • Where did you download youtube-dl (i.e. which version do you expect)?
  • A checksum (MD5 or so) of the file would be nice, as this the only question I can find showing the same error was a result of a flipped bit in the binary file.
  • Which version of Windows are you running?

@happyraver1958
Copy link
Author

Thank you very much for your prompt answer phihag!
I downloaded version 2014.06.09, which is the latest one I found in the list.
I am running Windows 7 Home Premium, 64-bit SP1 in a Toshiba U505 laptop.
I moved youtube-dl.exe from the \windows\system32 directory to my Users\Owner\Downloads directory and it ran fine from there. I don't know if it's because of the compatibility layers or something else; but it won't work if I run it through the Windows' path, it runs if it's called from the folder where the video was downloaded to.
Is this a bug to fix in the code somewhere?
Thanks again for the help! It did run perfectly fine from my Downloads directory.

@phihag
Copy link
Contributor

phihag commented Jun 11, 2014

Marvellous! You can put youtube-dl into, say, C:\ytdl, and then add C:\ytdl to your PATH to be able to run youtube-dl from any directory again.

@janeshdev
Copy link

I am still getting similar error. I just downloaded the software today. I added the environment variable as phihag suggested but I am still getting the following error.

File "C:\Python27\lib\site-packages\py2exe\boot_common.py", line 92, in
ImportError: No module named linecache
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named zipextimporter
Traceback (most recent call last):
File "main.py", line 2, in
ImportError: No module named future

@PaintOnBrush
Copy link

make sure you don't have a copy in your system32 directory.

@Lordtien
Copy link

I am facing similar error as well.

@MoffD
Copy link

MoffD commented May 23, 2016

I have had the same problem due to running it from a different directory, it worked after I cd'd into the same folder. Hopefully that helps someone if they're running it from a subdirectory like I was.
(Perhaps a pathing issue where youtube-dl can't find itself?)

@yan12125
Copy link
Collaborator

@MoffD Such a problem occurs if you put youtube-dl.exe in \Windows\System32.

@MoffD
Copy link

MoffD commented May 26, 2016

@yan12125 Interesting, however I was running it from my downloads folder with "..\youtube-dl.exe url_here" so it's not just isolated to the (DRIVE)\Windows\System32 path

@yan12125
Copy link
Collaborator

Please post the full path and the output of youtube-dl.exe -v url_here for both successful and failed cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants