yask123 / Instant-Music-Downloader

🎷 Downloads Music From The Web
http://iyask.me/Instant-Music-Downloader/
1.42k stars 160 forks source link

Fix pip Windows installation #44

Open aviaryan opened 9 years ago

aviaryan commented 9 years ago

Currently pip installation of instantmusic on Windows is unusable. This is because of the lack of console_scripts parameter in setup.py due to which no executable is created for series-renamer.

As a result, you get this error -

> instantmusic
'instantmusic' is not recognized as an internal or external command,
operable program or batch file.

To fix this, a console_script entry point is needed. Example : https://github.com/aviaryan/series-renamer/blob/master/setup.py#L28

The above setup works on all platforms perfectly.

yask123 commented 9 years ago

Ah, User zzleeper commented he was able to run it in windows https://news.ycombinator.com/item?id=10355030

BTW, on a fresh Win10 install (Py3.5) I had a bit of trouble b/c of the lack of extension. Had to add the .py prefix and it worked then :) reply

Can you confirm this ? I don't have access to windows machine right now.

bendtherules commented 9 years ago

Yes, the problem is that it creates a file called instantmusic in the scripts folder. But as the file lacks file extension, windows doesnt run it with python. For linux though, because of the !python at the top of this file, it runs with python.

Thus there are 2 easy ways of running this under windows -

  1. Call python instantmusic, or
  2. Rename to instantmusic.py and hopefully, if .py is set default to run with python, it will work. But for if some reason, .py is handled by something like a text editor, it will simply open there.

Thus, none of them is the preferred solution. Standard things like pip thus also use console_scripts entry point, which creates pip.exe and pip-script.py in the scripts folder, which will happily run if you call it like pip.

aviaryan commented 9 years ago

Call python instantmusic or python instantmusic.py

Doesn't work here. I assume python doesn't searches in PATH for filenames when they are passed as the parameter. But if python is default set to run *.py files, then changing the extension will do the trick. Then one can call instantmusic.py and it will work.

But as @bendtherules pointed out, this is not a standard solution and I will rather like using console_scripts entry point.

bendtherules commented 9 years ago

What I meant was to make those calls from the scripts directory.

yask123 commented 9 years ago

Can someone fix this ? https://github.com/yask123/Instant-Music-Downloader/blob/master/instantmusic-0.1/setup.py

I'll accept the PR

bendtherules commented 9 years ago

59 should fix this.

Side effect: libav-tools wont get installed automatically now on linux systems as special platform-dependent shell/batch scripts were removed.

gamegoofs2 commented 9 years ago

I'm guessing the solution for this hasn't been merged. What needs to be done to get this merged? I see there are conflicts. I run a Windows 8 machine, so I can do testing if need be.

bendtherules commented 9 years ago

Lots of files have been moved or removed in this branch. Unless, the main repo have added any content after I cloned from it, it should be ok to resolve the conflicts by replacing with the new content.

If you would like to test, please clone from https://github.com/bendtherules/Instant-Music-Downloader and run python setup.py install in that folder to try out this version.