python - 导出Python脚本

标签 python numpy

我正在使用BlenderPython并希望将 .py 文件提供给其他用户来使用我的脚本...我的脚本使用外部模块(如 NumPy ),这会引发错误(如 can't find module xxxx )。

并非所有人都可以安装 NumPy(甚至 Python :D),因为许多 Blender 用户只是艺术家。

另一个需要注意的是,NumPy 不能与 Blender 一起使用(我将其安装在系统的 Python 中,然后删除 Blender Python,因此它依赖于系统 Python)。

最佳答案

如果您想使用外部依赖项分发代码,那么您应该构建 Python egg 。创建 .egg 格式是为了解决您正在处理的问题。它是带有依赖项和元数据的代码的独立版本。 Here是一些关于如何创建 Python Egg 的信息。

关于python - 导出Python脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15069839/

相关文章:

python - 有没有什么方法可以将 Enter 键绑定(bind)到 Python 中的 Tkinter.Toplevel() 窗口?

python - 按名称获取多个 pandas 列的索引

python - Numpy 比例 3D 阵列

python - 平均颜色有点错误。 (np.mean())

python - 如何根据 URL 列表制作嵌套字典?

python - 为什么我在 Django formset_factory 中得到单个字段值?

python - 为什么这些点在Python中不相等?

python - 使用 SQLalchemy 从表中获取用户列表

python - 压缩Python列表中的所有连续的

python - 使用 np.sort 排序但结果不正确