【问题标题】:Importing module from Python non standard library从 Python 非标准库导入模块
【发布时间】:2020-11-13 18:15:08
【问题描述】:

我是这里的初学者。我正在尝试在 Python 中使用银行模拟器模块,其名称为银行sim,但我没有这样做。如果我编写代码import banksim,则会返回错误。此外,上述模块的开发人员没有提到pip install。谁能帮我解决这个问题?非常感谢!

模块位于: https://github.com/banking-project/banksim

我该如何使用它?

【问题讨论】:

    标签: python import module banking


    【解决方案1】:

    您可以克隆存储库或将其下载为 zip 并解压缩。只需将banksim 文件夹复制到您要在其中使用模块的项目的根文件夹中,然后从那里导入即可。

    还为存储库中的requirements.txt 运行pip install -r requirements.txt

    【讨论】:

      【解决方案2】:

      在包含pip.exe 的文件夹内创建一个名为requirements.txt 的文本文件。

      文件的内容应该是:

      mesa==0.8.5
      #dash==0.38.0  # The core dash backend
      #dash-html-components==0.13.5  # HTML components
      #dash-core-components==0.43.1  # Supercharged components
      #dash-table==3.5.0  # Interactive DataTable component (new!)
      #dash-daq==0.1.0  # DAQ components (newly open-sourced!)
      

      然后在你的命令提示符下运行pip install -r requirements.txt

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-05-19
        • 2016-04-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-02-26
        • 1970-01-01
        • 2020-10-26
        相关资源
        最近更新 更多