ModuleNotFoundError:没有名为“P4”的模块

2024-10-02 22:38:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我想为perforce使用python库。我通过导入P4创建了一个python脚本。为了使用它,我安装了perforce-p4python3,步骤如下:

created a file in /etc/apt/sources.list.d/perforce.list with below content

debhttp://package.perforce.com/apt/ubuntu/仿生释放

wget -qO - https://package.perforce.com/perforce.pubkey | sudo apt-key add - sudo apt-get update

sudo apt install perforce-p4python

当我执行python脚本时,我发现下面的错误

import P4
ModuleNotFoundError: No module named 'P4'

当我再次尝试安装时

sudo apt install perforce-p4python3
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    perforce-p4python3 is already the newest version (2020.1-1983437~bionic).
    0 upgraded, 0 newly installed, 0 to remove and 100 not upgraded.

当我执行pip冻结时,我看不到python。我错过什么了吗?。如何在python中使用P4()功能


Tags: install脚本compackagesudo步骤aptlist