我有一个 Python 程序,它使用 subprocess.Popen("scriptname.sh")
在其中使用 shell 脚本。在我自己的计算机上,调用有效,但上传到 PyPi 的版本找不到并调用脚本。 .sh 文件位于我的 tar.gz
文件中,因为我确定在我的 MANIFEST.in 文件中使用了 recursive-include *.sh
。此外,在 setup.py
中,我使用了 scripts = ["scriptname.sh"]
,如所见 here 也尝试调用 .sh 文件。现在在我的构建目录下看起来像这样:
- build
- lib
- .py files
- scripts-3.8
- .sh files
我收到的错误是 FileNotFoundError: [Errno 2] No such file or directory: 'filename.sh'
。
有没有办法仍然使用 subprocess.Popen()
按预期调用使用文件?