运行python包的模块(Running module of python package)

编程入门 行业动态 更新时间:2024-10-25 22:30:54
运行python包的模块(Running module of python package)

我试图从github执行一个名为plagcomps的包

我尝试使用以下命令执行extrinsic_testing模块:

python -m plagcomps.extrinsic.extrinsic_testing

我收到如下错误:

/usr/bin/python: No module named dbconstants

我试图寻找这个包,但无法在使用pip找到它。

或者还有其他我想念的东西?

I am trying to execute a package from github called plagcomps

I try to execute the extrinsic_testing module using the following command:

python -m plagcomps.extrinsic.extrinsic_testing

I get an error as follows:

/usr/bin/python: No module named dbconstants

I am trying to look for this package but cant find it in using pip.

Or is there something else I am missing?

最满意答案

查看产生异常的文件 (下次请发布完整的回溯):

from ..dbconstants import username, password, dbname ... url = "postgresql://%s:%s@%s" % (username, password, dbname)

它似乎希望您创建一个名为dbconstants.py的文件, dbconstants.py包含以下内容:

username = '...' password = '...' dbname = '...'

用有关postgres数据库的信息替换点。

Looking at the file that produces the exception (next time, please post the full traceback):

from ..dbconstants import username, password, dbname ... url = "postgresql://%s:%s@%s" % (username, password, dbname)

It seems that it expects you to create a file named dbconstants.py with the following content:

username = '...' password = '...' dbname = '...'

Replace the dots with the information about your postgres database.

更多推荐

本文发布于:2023-08-03 18:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1396290.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模块   python   Running   package   module

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!