如何方便地为 Python 3 安装 cx_Freeze?

Tri*_*ion 10 python apt software-installation pip

我想为 Python 3安装cx_Freeze。我的 Ubuntu 14.04 有 Python 2.7 和 Python 3.4。对于 Python 2,我可以非常方便地安装 cx_Freeze:

sudo apt install cx-freeze
Run Code Online (Sandbox Code Playgroud)

然而,这只会为 Python 2 安装 cx-freeze,而不是为 Python 3。此外,官方 cx_Freeze 网站不包含安装提示。我在从头开始构建软件方面并不是很坚定。我也尝试过pip3(版本 1.5.5)但无济于事:

pip3 install cx-freeze
could not find any downloads that satisfy the requirement
Run Code Online (Sandbox Code Playgroud)

因此问题:

  1. 是否有一种简单的(一行)方法来为 Python 3 安装 cx_Freeze?

  2. 如果没有,有人可以指导我逐步完成最简单的替代方案吗?


编辑:按照 Dumindu Mahawela 的回答,我得到以下输出:

Selecting previously unselected package cx-freeze-python3.
(Reading database ... 163736 files and directories currently installed.)
Preparing to unpack cx-freeze-python3_4.3-0ubuntu0px0pre2_amd64.deb ...
Unpacking cx-freeze-python3 (4.3-0ubuntu0px0pre2) ...
dpkg: dependency problems prevent configuration of cx-freeze-python3:
 cx-freeze-python3 depends on libpython3.2 (>= 3.2~a4); however:
  Package libpython3.2 is not installed.
 cx-freeze-python3 depends on python3 (<< 3.3); however:
  Version of python3 on system is 3.4.0-0ubuntu2.
 cx-freeze-python3 depends on python3.2; however:
  Package python3.2 is not installed.
 cx-freeze-python3 depends on cx-freeze-common; however:
  Package cx-freeze-common is not installed.

dpkg: error processing package cx-freeze-python3 (--install):
 dependency problems - leaving unconfigured
Run Code Online (Sandbox Code Playgroud)

这可能意味着链接的 debian 包不适用于最近的 Ubuntu 版本(需要 python3 << 3.3)。我不想为此回到 Python 3.2。

即使搜索更复杂的安装建议,我也没有发现任何问题。可能是 cx_Freeze 目前在 Ubuntu 上不能很好地支持 Python 版本 >= 3.3。如果是这样的话,我会继续前进并尝试不同的东西。感谢所有帮助的努力!

小智 2

cx-freeze-python3_4.3-0ubuntu0px0pre2_amd64.debLaunchpad.net下载。

使用以下命令安装该 .deb 文件:

sudo dpkg -i [.deb file name]
Run Code Online (Sandbox Code Playgroud)


ang*_*red 1

准确运行(或将其复制到终端中):-

sudo pip3 install cx_freeze
Run Code Online (Sandbox Code Playgroud)

您拼错了模块的名称。它是 cx_freeze,而不是 cx-freeze。顺便说一句,由于某种原因我遇到了问题,尽管它以前可以工作。无论如何,这对你有用,因为我使用的是 Ubuntu 的移植版本(Ubuntu MATE for RPi 2,感兴趣的人)。