jsvine / pdfplumber

Plumb a PDF for detailed information about each char, rectangle, line, et cetera — and easily extract text and tables.
MIT License
6.57k stars 659 forks source link

pip install UnicodeDecodeError #304

Closed ShaneKao closed 3 years ago

ShaneKao commented 3 years ago

Describe the bug

I got the following error message when installing.

` ERROR: Command errored out with exit status 1: command: 'd:\pyvm\ailabuap0.2-dev\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\user\AppData\Local\Temp\pip-install-l2zwa6vd\pdfplumber\setup.py'"'"'; file='"'"'C:\Users\user\AppData\Local\Temp\pip-install-l2zwa6vd\pdfplumber\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\user\AppData\Local\Temp\pip-pip-egg-info-xa95nanc' cwd: C:\Users\user\AppData\Local\Temp\pip-install-l2zwa6vd\pdfplumber\ Complete output (5 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\user\AppData\Local\Temp\pip-install-l2zwa6vd\pdfplumber\setup.py", line 19, in long_description = f.read() UnicodeDecodeError: 'cp950' codec can't decode byte 0xe2 in position 4981: illegal multibyte sequence

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

Code to reproduce the problem

pip install pdfplumber==0.5.24

Environment

jsvine commented 3 years ago

Seems like you may not have UTF-8 set as your default encoding. Does it work if you run it like this?:

LANG=en_US.UTF-8 pip install pdfplumber==0.5.24
jsvine commented 3 years ago

Now fixed in develop.

jsvine commented 3 years ago

Now available in v0.5.25.