3 ms·
I'll give an anectode from just last night. I wanted to fetch some online video, so I went ahead and downloaded youtube-dl-*.tar.gz, extracted it, and then trie
by kasabali 12y ago
I'll give an anectode from just last night. I wanted to fetch some online video, so I went ahead and downloaded youtube-dl-*.tar.gz, extracted it, and then tried to run it, all inside a cygwin session. For some reason, it did nothing. I ran file on the script and it claimed it was a data file. I run less on it and damn, it's a binary file. I was definitely surprised but didn't want to waste more time on it after fiddling for 10 minutes, I run the native Windows Python on the exact same file and it just worked.
I didn't look back so I don't know what was the main reason but I can say there are some problems.
- a3n 12y ago2424 pip install youtube-dl 2425 which youtube-dl 2426 youtube-dl --help 2427 youtube-dl https://www.youtube.com/watch?v=WS-JcaPFzp4 [youtube] WS-JcaPFzp4: Downloading webpage [youtube] WS-JcaPFzp4: Extracting video information [youtube] WS-JcaPFzp4: Downloading DASH manifest [download] Destination: The Renaissance and the cuckoo clock-WS-JcaPFzp4.mp4 [download] 100% of 7.98MiB in 00:02 2428 python --version 2429 which python 2430 history |tail This worked fine for me. It installed, help was available, I downloaded the video and watched it. I suspect one of two things, although it could be something else. You might be using the windows installation of python, rather than the cygwin installation. In most cases that works fine, but cygwin's python is compiled to expect a cygwin/unix-like environment, and windows python is compiled to expect windows. Sometimes weirdness ensues, and it's better to use cygwin's python in cygwin. My other suspicion is that the installation of youtube-dl didn't happen correctly. Notice above that I used pip, which is offered in the installation instructions. If you've installed pip that's usually your best/first option. Their first instructions involve downloading the gz (as you did). I did that with wget in python, then noticed the installation is an extraction and a chmod; I'm usually more comfortable trying pip in that circmstance. I've placed my email in my profile if you want to chat about this. I'll leave it there until I remember to remove it. Edit: you can run the python shell, and it will summarize python's construction: $ python Python 2.7.8 (default, Jul 28 2014, 01:34:03) [GCC 4.8.3] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> From a windows cmd.exe shell: python Python 2.7.6 |Anaconda 2.1.0 (64-bit)| (default, Nov 11 2013, 10:49:15) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
- kasabali 12y agoSorry I just saw your reply and I'm not on Windows right now. I'll check when I boot it.
- a3n 12y agoFollowup: I discovered/realized that, even though I was using cygwin's python, the windows python (Anaconda in my case) was still in my cygwin path, because the cygwin path has the windows path elements in it. You can see that if you run this, and see two pythons: which -a python I discovered this when I ran pip and ipython in cygwin, and they "worked," i.e. something ran, but not right. I put this at the end of my .bashrc to remove windows python from cygwin's path: export PATH=$(echo $PATH |sed -e "s/:[^:]*Anaconda[^:]*:/:/g" |sed -e "s/:[^:]*Anaconda[^:]*:/:/g") There were two anaconda directories in the path, and /g should have taken care of both, but my RE-fu is apparently lacking, so brute force. Cygwin has pitfalls.