Instant-Music-Downloader icon indicating copy to clipboard operation
Instant-Music-Downloader copied to clipboard

Fix pip Windows installation

Open aviaryan opened this issue 9 years ago • 8 comments

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.

aviaryan avatar Oct 09 '15 17:10 aviaryan

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.

yask123 avatar Oct 09 '15 18:10 yask123

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.

bendtherules avatar Oct 09 '15 19:10 bendtherules

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.

aviaryan avatar Oct 09 '15 20:10 aviaryan

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

bendtherules avatar Oct 09 '15 21:10 bendtherules

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

I'll accept the PR

yask123 avatar Oct 11 '15 19:10 yask123

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

bendtherules avatar Oct 12 '15 01:10 bendtherules

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.

gamegoofs2 avatar Oct 13 '15 02:10 gamegoofs2

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.

bendtherules avatar Oct 13 '15 07:10 bendtherules