divijbindlish / parse-torrent-name

Extract media information from a filename
MIT License
215 stars 60 forks source link

Unable to PIP Install. #23

Open deshah10 opened 5 years ago

deshah10 commented 5 years ago

Hi, I am currently running Python 3.7.1. When attempting to do "pip install parse-torrent-name", i get the following error:

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Unfortunately, I wasnt sure how to fix this error myself, however one way I got around to be able to use your wonderful script was by doing the following:

  1. Create a new folder locally called PTN.
  2. Inside the folder I created 2 new files called parse.py and patterns.py
  3. Then for each of the new files, I copied the raw code, from this github, for each of the respective files and pasted them to their respective files above.
  4. Finally the last fix I had to apply, was within your local parse.py file, I had to change .patterns to pattern, to make it:from patterns import patterns, types.

Now you can make use of the script as you please, I tested it and it works well.

shifqu commented 4 years ago

Hi,

First off, I am not related to this project, but I just figured I'd share what I found out.

Environment:

So, when I tried pip install parse-torrent-name I received the following error:

Collecting parse-torrent-name (from -r requirements\common.txt (line 5))
  Downloading https://files.pythonhosted.org/packages/1a/c9/fbafe4f215ff24a1209e848763699cb8831d459c138fe164ea45b04c02ea/parse-torrent-name-1.1.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "Z:\Users\shifqu\AppData\Local\Temp\pip-install-dggs211f\parse-torrent-name\setup.py", line 5, in <module>
        description = f.read()
      File "Z:\Program Files (x86)\Python37-32\lib\encodings\cp1252.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 292: character maps to <undefined>

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in Z:\Users\shifqu\AppData\Local\Temp\pip-install-dggs211f\parse-torrent-name\

The important part here is the Traceback part, rather than the last line (Command "python...)

As you can read in the traceback, the error occurs in "...\parse-torrent-name\setup.py", line 5 when description = f.read() is executed.

I checked the file in github and noticed that line 5 here is: readme_path = os.path.join(os.path.dirname(__file__), 'README.md')

So this is how I assumed that the pip version I am trying to install is different from the master-branch.

Because of this, instead of installing parse-torrent-name from pip, I install it directly from git: pip install git+git://github.com/divijbindlish/parse-torrent-name.git#egg=parse-torrent-name

If you are using a requirements.txt file, you can just add git+git://github.com/divijbindlish/parse-torrent-name.git#egg=parse-torrent-name to it.

After installing PTN like this, everything works like a charm :ok_hand:

TL;DR pip version is outdated, install using git+git protocol

Useful resource on git+git protocol