gpt4 book ai didi

ubuntu-14.04 - Ubuntu 14.04 上的 Python3.8

转载 作者:行者123 更新时间:2023-12-05 01:33:49 25 4
gpt4 key购买 nike

我正在尝试在 Ubuntu 14.04 上安装 Python3.8,我得到这个错误:

E: Unable to locate package python3.8 E: Couldn't find any package byregex 'python3.8'

有没有可能在这么旧的 Ubuntu 上安装 python3.8?如果可能的话,请告诉我怎么做。

编辑

从源安装时(我遵循了 instruction)我收到此错误:

Fatal Python error: _PySys_InitCore: can't initialize sys modulePython runtime state: preinitialized

Current thread 0x00002ab78e1b3740 (most recent call first): generate-posix-vars failed make: *** [pybuilddir.txt] Error 1

最佳答案

另一种解决方案是在较新的系统上静态编译 python。然后可以将这些二进制文件传输到目标系统。

编译在 vanilla Ubuntu 20.04 LTS 上测试

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
$ sudo apt-get install build-essential checkinstall
$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
$ wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz
$ tar xzf Python-3.8.6.tgz
$ cd Python-3.8.6
$ ./configure LDFLAGS="-static" --disable-shared
$ make LDFLAGS="-static" LINKFORSHARED=" "
....
$ cd ..
$ zip -r Python-3.8.6.zip Python-3.8.6

将 Python-3.8.6.zip 传输到目标系统

$ unzip Python-3.8.6.zip
$ cd Python-3.8.6
$ ./python

当然可以

make install

或清除此文件夹,这是您的选择。

关于ubuntu-14.04 - Ubuntu 14.04 上的 Python3.8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64333458/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com