【问题标题】:easy-install with Portable Python: no module named parse使用 Portable Python 轻松安装:没有名为 parse 的模块
【发布时间】:2012-08-24 10:54:14
【问题描述】:

我已经在 Windows XP 上安装了带有 Portable Python 2-7 的 easy_install(通过分发模块)。但是当我输入 DOS 命令时,例如

easy_install pandas

我得到以下信息:

我在互联网上没有找到任何“解析”模块(并且“easy_install 解析”产生相同的输出)

【问题讨论】:

  • urllib.parse 是一个 python3 模块,所以要么pandas 不支持 python 2.x 要么在源代码上运行 2to3 工具

标签: python pandas easy-install portable-python


【解决方案1】:

错误是关于模块urllib.parse,而不是parse。 urlparse module 的文档说:

urlparse 模块在 Python 3 中重命名为 urllib.parse。

这意味着您的代码需要与 Python 3 一起运行。您正在运行 Python 2.7,这意味着它不会工作(因为模块 urllib.parse 仍称为 urlparse)。也许您需要考虑安装支持 Python 3 的 Portable Python 版本?

【讨论】:

  • 谢谢。但我刚刚从 Portable Python 3 转移到 Portable Python 2,因为我也很难用 Python 3 安装模块,而且 Python 2 中有更多预安装的模块...
猜你喜欢
  • 2021-02-05
  • 1970-01-01
  • 2012-01-29
  • 2023-03-21
  • 1970-01-01
  • 1970-01-01
  • 2019-03-14
  • 2015-03-30
  • 1970-01-01
相关资源
最近更新 更多