如何正确导入cinegoer模块。示例方法不再适用于我吗?

问题描述 投票:0回答:1

所以我在我正在开发的电影数据库程序中使用了 IMDBpy 几年。但在改成 Cinemagoer 后,我一直无法让它持续工作。

import os
os.system('git+https://github.com/cinemagoer/cinemagoer')
os.system('pip install cinemagoer')
from imdb import Cinemagoer

# create an instance of the Cinemagoer class
ia = Cinemagoer()

# get a movie
movie = ia.get_movie('0133093')

它总是产生相同的“ModuleNotFoundError:没有名为“imdb”的模块”错误。

对此的任何帮助都非常棒,我很高兴让我的程序再次运行。

python imdbpy
1个回答
0
投票

我认为问题在于您尝试将安装作为脚本的一部分运行。我能够创建一个 virtualenv,运行 pip install,然后使用 示例代码 获得正确的输出。

此外,我注意到在提供的代码中您运行了两次输入,一次使用 github,一次使用 PyPI。你只需要一个。

© www.soinside.com 2019 - 2024. All rights reserved.