简体   繁体   English

带有多个python文件的PyInstaller

[英]PyInstaller with multiple python files

I would like to make a program x.py into an executable(.exe) with Pyinstaller . 我想提出一个程序x.py成可执行文件(.exe)与Pyinstaller I am able to do this just fine when x.py does not depend on any user scripts with: x.py不依赖于以下任何用户脚本时,我能够做到这一点:

python pyinstaller.py -w x.py

How can I make this work when I am importing another script I have written, y.py , into x.py ? 当我将我编写的另一个脚本y.py导入x.py时,该如何工作? I have tried using -p DIR to specify the path to y.py like so: 我试过使用-p DIR来指定y.py的路径, y.py所示:

 python pyinstaller.py -p \projectfolder -w x.py

But that did not solve the issue. 但这并不能解决问题。

I got this working by having the files in the same directory. 我通过将文件放在同一目录中来工作。 My issue actually turned out to be with a known bug in pyinstaller with scipy. 我的问题实际上是与scipy相关的pyinstaller中的一个已知错误 The solution to this was adding this import: 解决方案是添加此导入:

from scipy.sparse.csgraph import _validation  

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

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