简体   繁体   English

从没有 setup.py 的 GitHub 仓库导入 python 模块

[英]Import python module from a GitHub repo that does not have setup.py

I want to import OpenBulletToPython library from GitHub So how do I do that?我想从 GitHub 导入 OpenBulletToPython 库那么我该怎么做呢? When I tried using pip install git+https://github.com/Categorically/OpenBulletToPython , I receive an ERROR: File "setup.py" not found for legacy project git+https://github.com/Categorically/OpenBulletToPython.当我尝试使用pip install git+https://github.com/Categorically/OpenBulletToPython时,我收到一个ERROR: File "setup.py" not found for legacy project git+https://github.com/Categorically/OpenBulletToPython. So how can I import it??那我怎么导入呢??

Unfortunately the repository you linked to does not have a setup script.不幸的是,您链接到的存储库没有安装脚本。
So, you basically have to options:所以,你基本上必须选择:

  1. Copy & Paste the code into the project where you want to use it (check the license before you do this)将代码复制并粘贴到您要使用它的项目中(在执行此操作之前检查许可证)
  2. Fork the repository and add a setup script yourself (as described here )分叉存储库并自己添加安装脚本(如此所述)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM