【发布时间】:2021-01-07 12:03:17
【问题描述】:
最近我在 VirtualBox 6.1 上安装了 Neverware 的 Chromium OS 版本,称为 Cloudready,用于为 Chromebook 开发 Python 应用程序。此版本的 Chromium OS 是 48.0.2564.116 开发人员版本(由于图形不兼容,无法安装较新版本)。由于我没有 Google 帐户,因此我以访客用户身份登录 Chromium OS(不知何故,我以访客身份拥有管理权限,这对我的开发目的有好处)。
我发现预装了 Python 2.7.3。我尝试安装 Python 3.6,为此,我尝试找到预装的包管理器,最终我找到了。预装的包管理器(portage),不安装任何东西,因为它给出了类似于这个的错误:
chronos@localhost / $ sudo emerge dev-lang/python:3.6
!!! PORTAGE_BINHOST unset, but use is requested.
!!! Problem with sandbox library. Disabling...
Calculating dependencies... done!
WARNING: A requested package will not be merged because it is listed in
package.provided:
dev-lang/python:3.6 pulled in by 'args'
>>> Auto-cleaning packages...
>>> No outdated packages were found on your system.
chronos@localhost / $
我尝试从get-pip.py 提供的here 脚本中为 Python 2 安装 Python PIP,并且成功了。因为我想为我的 Chromebook 程序创建图形界面,所以我想安装 tkinter 模块,并且因为我不希望我的程序的用户必须使用终端来执行我的 Python 程序并安装 Python 模块,我想安装 PyInstaller。我想通过 PIP 安装 PyInstaller,但是 PIP 对于任何尝试的模块安装都会抛出以下错误:
/usr/local/lib64/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:387: SNIMissingWarning: An HTTPS requ
est has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. Thi
s may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can up
grade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/l
atest/advanced-usage.html#ssl.warnings
SNIMissingWarning,
/usr/local/lib64/python2.7/site-packages/pip_vendor/urllib3/util/ssl_.py:142: InsecurePlatformWarning: A true
SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause cert
ain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information,
see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning,
在尝试安装 PyInstaller 时,PIP 实际上设法收集了 pyinstaller-4.0.tar.gz 包,但安装失败,因为 PyInstaller 安装程序引发异常/错误 BackendUnavailable,然后 PIP 再次引发 InsecurePlatformWarning 错误。正如@BryanOakley 所指出的,我无法从 PIP 安装 Tkinter,我在使用 Chromium OS 时忘记了这一点(例如,在 Ubuntu 上安装 Tkinter 的命令是 sudo apt-get install python3-tk),这让事情变得更加棘手。
从出现的错误看来,我必须安装更新版本的 Python(我已经尝试过,但无济于事)。我尝试通过安装 Anaconda 3 和 Miniconda 3 来安装 Python 3,但两者都提供了相同的错误,我什至查看了 Stack Overflow 以及人们投票为 answer 的内容仍然对我不起作用。以下命令...
$ mkdir ~/Downloads/TMP
$ TMPDIR=~/Downloads/TMP sudo bash ~/Downloads/Miniconda3-latest-Linux-x86_64.sh -p /usr/local/miniconda3
...最终导致这个输出:
/usr/local/miniconda3/conda.exe: error while loading shared libraries: libz.so.1: failed to segment from sh
ared object: Operation not permitted
/usr/local/miniconda3/conda.exe: error while loading shared libraries: libz.so.1: failed to segment from sh
ared object: Operation not permitted
到目前为止没有任何效果。如何在 Chromium OS 版本 48 上成功安装带有 Tkinter 和 PyInstaller 的 Python 3.6,而无需安装 Linux 容器/环境(例如安装官方 Linux(Beta)或 Crouton 的选项)或从 Google Play 商店安装任何东西?
【问题讨论】:
-
tkinter 无法通过 pip 安装。
-
哎呀。我忘记了不能使用 PIP 安装 Tkinter 的事实。考虑到这一点,我编辑了这篇文章。
标签: python python-3.x tkinter pyinstaller google-chrome-os