小编sta*_*biz的帖子

如何在 Ubuntu 20.04 LTS 中将默认 python3 设置为 python 3.9 而不是 python 3.8

我已经在 Ubuntu 20.04 LTS 中安装了 Python 3.9。现在系统同时拥有Python 3.8和Python 3.9。

# which python
# which python3
/usr/bin/python3
# which python3.8
/usr/bin/python3.8
# which python3.9
/usr/bin/python3.9
# ls -alith /usr/bin/python3
12583916 lrwxrwxrwx 1 root root 9 Jul 19  2021 /usr/bin/python3 -> python3.8
Run Code Online (Sandbox Code Playgroud)

但该pip3命令仍会将所有内容安装到 Python 3.8 目录中。

# pip3 install --upgrade --find-links file:///path/to/directory <...>
Run Code Online (Sandbox Code Playgroud)

我想通过将符号链接 /usr/bin/python3 更新为 /usr/bin/python3.9 来更改默认的 pip3 行为。

怎么做?

# update-alternatives --set python3 /usr/bin/python3.9
This command will not work as expected.
Run Code Online (Sandbox Code Playgroud)

这是 pip3 信息:

# which pip3
/usr/bin/pip3 …
Run Code Online (Sandbox Code Playgroud)

python ubuntu python-3.x

24
推荐指数
2
解决办法
7万
查看次数

pip3无法下载最新的tflite-runtime

当前版本tflite-runtime2.11.0

https://pypi.org/project/tflite-runtime/

tflite-runtime这是下载到文件夹的测试tmp

mkdir -p /tmp/test
cd /tmp/test

echo "tflite-runtime == 2.11.0" > ./test.txt

pip3 download -r ./test.txt
Run Code Online (Sandbox Code Playgroud)

这是错误:

ERROR: Could not find a version that satisfies the requirement tflite-runtime==2.11.0 (from versions: none)
ERROR: No matching distribution found for tflite-runtime==2.11.0
Run Code Online (Sandbox Code Playgroud)

这是 pip3 版本:

# pip3 --version
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
Run Code Online (Sandbox Code Playgroud)

上面有什么问题pip3 download吗?为什么找不到最新版本?以及如何修复?

python ubuntu pip tensorflow-lite

6
推荐指数
1
解决办法
4363
查看次数

Ubuntu 22.04 上的 Eclipse 2022-06 启动问题

在 Ubuntu 22.04 上使用 Eclipse 2022-06/03 存在一些问题。

下面的 eclipse 图像使用的是这个版本:

https://www.eclipse.org/downloads/packages/release/2022-06/rc1/eclipse-ide-enterprise-java-and-web-developers

启动画面未位于屏幕中央。

在此输入图像描述

为什么eclipse不能把启动图片放在中间?这是eclipse的BUG还是与Ubuntu 22.04上缺少未知软件包有关?

eclipse ubuntu

3
推荐指数
1
解决办法
2230
查看次数

python set() 类中 &amp;= 运算符的作用是什么

这是getImgIds来自pycocotools

pycocotools/coco.py:

def getImgIds(self, imgIds=[], catIds=[]):
    '''
    Get img ids that satisfy given filter conditions.
    :param imgIds (int array) : get imgs for given ids
    :param catIds (int array) : get imgs with all given cats
    :return: ids (int array)  : integer array of img ids
    '''
    imgIds = imgIds if _isArrayLike(imgIds) else [imgIds]
    catIds = catIds if _isArrayLike(catIds) else [catIds]

    if len(imgIds) == len(catIds) == 0:
        ids = self.imgs.keys()
    else:
        ids = set(imgIds)
        for i, …
Run Code Online (Sandbox Code Playgroud)

python pycocotools

-2
推荐指数
1
解决办法
178
查看次数