Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
150 views
in Technique[技术] by (71.8m points)

python - pip install UnicodeDecodeError

When I'm trying to install beautifulsoup4 on my new notebook (Win 7 64) using pip, I get this error:

Cleaning up...
Exception:
Traceback (most recent call last):
  File "C:Python27libsite-packagespipasecommand.py", line 122, in main
    status = self.run(options, args)
  File "C:Python27libsite-packagespipcommandsinstall.py", line 278, in run

    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl
e=self.bundle)
  File "C:Python27libsite-packagespip
eq.py", line 1234, in prepare_files
    req_to_install.assert_source_matches_version()
  File "C:Python27libsite-packagespip
eq.py", line 464, in assert_source_ma
tches_version
    % (display_path(self.source_dir), version, self))
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9e in position 58: ordinal
 not in range(128)

Traceback (most recent call last):
  File "C:Python27lib
unpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:Python27lib
unpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:Python27Scriptspip.exe\__main__.py", line 9, in <module>
  File "C:Python27libsite-packagespip\__init__.py", line 185, in main
    return command.main(cmd_args)
  File "C:Python27libsite-packagespipasecommand.py", line 161, in main
    text = '
'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9e in position 73: ordinal
 not in range(128)

I use: pip install beautifulsoup4 command

Do you have an idea where could be the problem?

PS: The notebook was used for presentations before get it, so there are programs in multiple languages installed.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Or simply, you can run the following command on your system right before pip install, and voila:

export LC_ALL="en_US.UTF-8"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...