Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Sandra Salinas
Sandra Salinas
87 Points

Hi I can't install match by pip,

Hi, I can't install match by using pip on windown, this is error I got, any suggest on this case?. I can install another package ok. thanks

C:\WINDOWS\system32>pip install match Collecting match Using cached match-0.3.0.tar.gz (5.0 kB) ERROR: Command errored out with exit status 1: command: 'c:\python3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\ken.van\AppData\Local\Temp\pip-install-dktr0rd3\match\setup.py'"'"'; file='"'"'C:\Users\ken.van\AppData\Local\Temp\pip-install-dktr0rd3\match\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\ken.van\AppData\Local\Temp\pip-install-dktr0rd3\match\pip-egg-info' cwd: C:\Users\ken.van\AppData\Local\Temp\pip-install-dktr0rd3\match\ Complete output (9 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\ken.van\AppData\Local\Temp\pip-install-dktr0rd3\match\setup.py", line 19, in <module> long_description=readme(), File "C:\Users\ken.van\AppData\Local\Temp\pip-install-dktr0rd3\match\setup.py", line 8, in readme return f.read() File "c:\python3\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 0x9d in position 266: character maps to <undefined> ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

1 Answer

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 28,720 Points

Yes, you found a bug that the maintainer has not dealt with or documented.

The installer is NOT currently compatible with windows.

https://pypi.org/project/match/

Here's what I got-- see below.

(test) PS C:\env> pip install match
Collecting match
  Using cached match-0.3.0.tar.gz (5.0 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\env\test\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Jeffrey\\AppData\\Local\\Temp\\pip-install-bd1y31i0\\match\\setup.py'"'"'; __file__='"'"'C:\\Users\\Jeffrey\\AppData\\Local\\Temp\\pip-install-bd1y31i0\\match\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Jeffrey\AppData\Local\Temp\pip-install-bd1y31i0\match\pip-egg-info'
         cwd: C:\Users\Jeffrey\AppData\Local\Temp\pip-install-bd1y31i0\match\
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Jeffrey\AppData\Local\Temp\pip-install-bd1y31i0\match\setup.py", line 19, in <module>
        long_description=readme(),
      File "C:\Users\Jeffrey\AppData\Local\Temp\pip-install-bd1y31i0\match\setup.py", line 8, in readme
        return f.read()
      File "c:\env\test\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 0x9d in position 266: character maps to <undefined>
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Good news, you can go to the Github site and download and manually install "match".

https://github.com/EducationalTestingService/match

  1. Find the GREEN BUTTON labeled Clone or Download and download the ZIP file

  2. Extract the ZIP file and make a note of its location.

  3. Navigate into the unzipped files and find the subdirectory labeled "match" and copy the entire folder

  4. Paste the folder into c:\python3\Lib\site-packages

  5. make sure you have NLTK installed with pip

pip install nltk

Finally, run Python and see if it is working

(test) PS C:\env> python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import match
>>> original_text = "I   am writing a letter !  Sometimes,I forget to put spaces (and do weird stuff with punctuation)  ?  J'aurai une pomme, s'il vous plΓ’it !"
>>> original_text
"I   am writing a letter !  Sometimes,I forget to put spaces (and do weird stuff with punctuation)  ?  J'aurai une pomme, s'il vous plΓ’it !"
>>> match.match(original_text, ['-LRB-', 'and', 'do', 'weird', 'stuff', 'with', 'punctuation', '-RRB-'])
[(60, 97, '(and do weird stuff with punctuation)')]
>>>