Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install the package by pip due to some encoding error #2

Open
saulshao opened this issue Jan 7, 2019 · 10 comments
Open

Cannot install the package by pip due to some encoding error #2

saulshao opened this issue Jan 7, 2019 · 10 comments

Comments

@saulshao
Copy link

saulshao commented Jan 7, 2019

When I try to install the package via pip command, it generates the following error message:

Collecting pygetwindow (from pyautogui)
Downloading https://files.pythonhosted.org/packages/f1/54/740939161eb3471e8f775ce9b0fcac0e54c36bf63501e51f2cd7158f587d/PyGetWindow-0.0.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users******\AppData\Local\Temp\pip-install-wflouosi\pygetwindow\setup.py", line 11, in
long_description = fh.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 905: illegal multibyte sequence

So I tried to modify the setup.py and change the line 11:
Original:
with open("README.md", "r") as fh: long_description = fh.read()
New:
with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read()

It looks like this change can bypass the issue,

@zhongxiali
Copy link

I got the same error message when install via pip and python 3.7

@WangElysion
Copy link

But it is no use on my computer.....I have used python2.7.

@jtyoui
Copy link

jtyoui commented Jan 23, 2019

因为要安装pyautogui,结果要先安装依赖PyGetWindow,然后pip install PyGetWindow报错。
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 905: illegal multibyte sequence
我下载源码修改setup.py,将with open("README.md", "r") 修改成 with open("README.md", "r", encoding="utf-8")。
使用wheel进行安装即可。
安装命令:
python setup.py bdist_wheel
pip install dist/*

@lovedva
Copy link

lovedva commented Mar 1, 2019

因为要安装pyautogui,结果要先安装依赖PyGetWindow,然后pip install PyGetWindow报错。
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 905: illegal multibyte sequence
我下载源码修改setup.py,将with open("README.md", "r") 修改成 with open("README.md", "r", encoding="utf-8")。
使用wheel进行安装即可。
安装命令:
python setup.py bdist_wheel
pip install dist/*
创建不了wheel,想在win7上装,然后发现完全不会用win的python

@jtyoui
Copy link

jtyoui commented Mar 1, 2019

因为要安装pyautogui,结果要先安装依赖PyGetWindow,然后pip install PyGetWindow报错。
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 905: illegal multibyte sequence
我下载源码修改setup.py,将with open("README.md", "r") 修改成 with open("README.md", "r", encoding="utf-8")。
使用wheel进行安装即可。
安装命令:
python setup.py bdist_wheel
pip install dist/*
创建不了wheel,想在win7上装,然后发现完全不会用win的python
wheel是第三方库.先要安装.pip install wheel

@Crescent-Saturn
Copy link

因为要安装pyautogui,结果要先安装依赖PyGetWindow,然后pip install PyGetWindow报错。
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 905: illegal multibyte sequence
我下载源码修改setup.py,将with open("README.md", "r") 修改成 with open("README.md", "r", encoding="utf-8")。
使用wheel进行安装即可。
安装命令:
python setup.py bdist_wheel
pip install dist/*

谢谢你的方案,完美解决~
我也是安装pyautogui时遇到同样报错,发现是这个库报错,真希望UTF赶紧统一吧。。。
给跪了。。。

@mrchibbo
Copy link

mrchibbo commented Apr 3, 2019

excellent solustion, thanks!

@huhuang03
Copy link

huhuang03 commented Apr 14, 2019

因为要安装pyautogui,结果要先安装依赖PyGetWindow,然后pip install PyGetWindow报错。
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 905: illegal multibyte sequence
我下载源码修改setup.py,将with open("README.md", "r") 修改成 with open("README.md", "r", encoding="utf-8")。
使用wheel进行安装即可。
安装命令:
python setup.py bdist_wheel
pip install dist/*

谢谢你的方案,完美解决~
我也是安装pyautogui时遇到同样报错,发现是这个库报错,真希望UTF赶紧统一吧。。。
给跪了。。。

可以使用pip install -e 项目路径,快捷安装

@imbillow
Copy link

why not merge? I see it has some pr to fix the problem.

@alexlausz
Copy link

因为要安装pyautogui,结果要先安装依赖PyGetWindow,然后pip install PyGetWindow报错。
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 905: illegal multibyte sequence
我下载源码修改setup.py,将with open("README.md", "r") 修改成 with open("README.md", "r", encoding="utf-8")。
使用wheel进行安装即可。
安装命令:
python setup.py bdist_wheel
pip install dist/*

我在32位python下用此方法安装pygetwindow版本0.04不行,0.03版本可以

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants