【问题标题】:'easy_install' is not recognized as an internal or external command, operable program or batch file'easy_install' 不是内部或外部命令、可运行程序或批处理文件
【发布时间】:2022-01-06 16:07:18
【问题描述】:

我无法运行easy_install,即使已经安装了setuptools。顺便说一句,我可以在 ...\Lib\site-packages\setuptools\command 目录下看到 easy_install.py 文件,但在 .../Scripts 目录下没有 easy_install.exe 文件。所以问题不在于 PATH 没有添加,因为找不到 .exe。

  • 安装工具 58.0.4
  • python 3.8.8
  • Windows 10

不知道有没有办法直接调用easy_install.py来安装.egg包?

【问题讨论】:

  • Python 在 3.7 版丢失了 easy_install。算了,用pip吧。
  • @phd 你确定吗?那么如何从本地 .egg 文件安装呢?
  • 要么降级到 2.7-3.7 范围内的 Python 版本。或者忘记鸡蛋,使用轮子。

标签: python-3.x setuptools easy-install


【解决方案1】:

解决方案是在 python 脚本中调用 easy_install(感谢 GitHub 用户 @emailweixu source)。

from setuptools import setup

if __name__ == '__main__':
    setup( script_args = [ '-q', 'easy_install'
                         , '-v', 'PATH_TO_YOUR_EGG_FILE'
                         ]
         )

请注意,当setuptools 完全从其代码包中删除easy_install 时,这种骇人听闻的解决方案在未来将不起作用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-08-25
    • 2014-06-01
    • 2016-07-07
    • 2021-12-20
    • 2016-12-03
    • 2019-04-25
    • 2015-05-16
    相关资源
    最近更新 更多