当前位置:   article > 正文

window操作Python27_python27下载

python27下载

1. 安装Python27

1.1 下载 python27 安装包

1.2 安装

  • 双击安装包,进入安装页面,之后一直傻瓜式安装。

1.3 配置环境变量

  • PATH 添加 Python 的安装路径

1.4 验证

  • 打开 cmd 命令提示符,输入Python2,可以正确进入 Python 命令行操作界面,表示安装成功。

2. pip 安装模块错误

C:\Python27\Scripts>pip install numpy==1.9.3
Collecting numpy==1.9.3
  Cache entry deserialization failed, entry ignored
Exception:
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\python27\lib\site-packages\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "c:\python27\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "c:\python27\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "c:\python27\lib\site-packages\pip\download.py", line 821, in unpack_url
    hashes=hashes
  File "c:\python27\lib\site-packages\pip\download.py", line 659, in unpack_http_url
    hashes)
  File "c:\python27\lib\site-packages\pip\download.py", line 880, in _download_http_url
    file_path = os.path.join(temp_dir, filename)
  File "c:\python27\lib\ntpath.py", line 85, in join
    result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 7: ordinal not in range(128)
You are using pip version 9.0.1, however version 22.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 错误原因:执行 c:\python27\lib\ntpath.py 文件时,result_path = result_path + p_path 语句,进行地址拼接是有中文字符。
  • 解决方法:
# 打开c:\python27\lib\ntpath.py,添加下面语句。
import sys
reload(sys)
sys.setdefaultencoding("GBK")
  • 1
  • 2
  • 3
  • 4
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/904976
推荐阅读
相关标签
  

闽ICP备14008679号