Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FBS pro freeze fails on Python 3.6 due to subprocess unexpected args error #262

Open
meramsey opened this issue Dec 27, 2021 · 2 comments
Open

Comments

@meramsey
Copy link
Contributor

Welcome to fbs's issue tracker!

Have you already purchased a license for fbs, or are you planning to do so in the near future?
yes a paid license holder

  • Your operating system(s) Ubuntu
  • Your Python: version 3.6.12
  • Your fbs version: fbs_pro-1.0.8.tar.gz
  • Your PyInstaller version: PyInstaller-4.7
  • Your PyQt / PySide version: PyQt5==5.15.6
  • A copy of any error messages you are getting. Use three backticks ... before and after to format them.
  • A (minimal!) script that reproduces the problem you are experiencing.

When freezing with fbs pro 1.0.8 it fails

ubuntu:WizardAssistant$ fbs freeze && fbs installer
Traceback (most recent call last):
  File "/root/.pyenv/versions/3.6.12/bin/fbs", line 8, in <module>
    sys.exit(_main())
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/__main__.py", line 17, in _main
    fbs.cmdline.main()
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/cmdline.py", line 32, in main
    fn(*args)
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/builtin_commands/__init__.py", line 151, in freeze
    freeze_ubuntu(debug=debug)
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/freeze/ubuntu.py", line 4, in freeze_ubuntu
    freeze_linux(debug)
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/freeze/linux.py", line 8, in freeze_linux
    run_pyinstaller(debug=debug)
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/freeze/__init__.py", line 47, in run_pyinstaller
    cp = run(args, capture_output=True, text=True)
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'
ubuntu:WizardAssistant$

In this file:
fbs/freeze/init.py

When using fbs_pro-1.0.8.tar.gz with the below which is the default it fails

cp = run(args, capture_output=True, text=True)

Free fbs uses this which works without issue

cp = run(args, check=True)

I modified the file in place and reran and it works. Seems like this should be fixed in the next pro version so it is usuable was using same python version in each

Full logs:

@ fbs runvm ubuntu
You are now in a Docker container running Ubuntu. To build your app
for this platform, use the normal commands `fbs freeze` etc.

Note that you can't launch GUIs here. So eg. `fbs run` won't work.

Another caveat is that target/ here is special: It symlinks to your
usual target/ubuntu/. So when you are done and type `exit` to leave
this container, you can find the produced binaries there.
ubuntu:WizardAssistant$ fbs freeze && fbs installer
Done. You can now run `target/WizardAssistant/WizardAssistant`. If
that doesn't work, see https://build-system.fman.io/troubleshooting.
Created target/WizardAssistant.deb. You can for instance install it
via the following command:
    sudo dpkg -i target/WizardAssistant.deb
This places it in /opt/WizardAssistant. To uninstall it again, you can
use:
    sudo dpkg --purge WizardAssistant
ubuntu:WizardAssistant$ pip install redacted_url/fbs_pro-1.0.8.tar.gz
Collecting redacted_url/fbs_pro-1.0.8.tar.gz
  Downloading redacted_url/fbs_pro-1.0.8.tar.gz (202 kB)
     |################################| 202 kB 570 kB/s            
  Preparing metadata (setup.py) ... done
Collecting PyInstaller>=4.4
  Downloading pyinstaller-4.7-py3-none-manylinux2014_x86_64.whl (1.5 MB)
     |################################| 1.5 MB 1.3 MB/s            
Requirement already satisfied: setuptools in /root/.pyenv/versions/3.6.12/lib/python3.6/site-packages (from PyInstaller>=4.4->fbs==1.0.8) (40.6.2)
Requirement already satisfied: altgraph in /root/.pyenv/versions/3.6.12/lib/python3.6/site-packages (from PyInstaller>=4.4->fbs==1.0.8) (0.17.2)
Requirement already satisfied: importlib-metadata in /root/.pyenv/versions/3.6.12/lib/python3.6/site-packages (from PyInstaller>=4.4->fbs==1.0.8) (4.8.3)
Collecting pyinstaller-hooks-contrib>=2020.6
  Downloading pyinstaller_hooks_contrib-2021.4-py2.py3-none-any.whl (215 kB)
     |################################| 215 kB 1.7 MB/s            
Requirement already satisfied: typing-extensions>=3.6.4 in /root/.pyenv/versions/3.6.12/lib/python3.6/site-packages (from importlib-metadata->PyInstaller>=4.4->fbs==1.0.8) (4.0.1)
Requirement already satisfied: zipp>=0.5 in /root/.pyenv/versions/3.6.12/lib/python3.6/site-packages (from importlib-metadata->PyInstaller>=4.4->fbs==1.0.8) (3.6.0)
Building wheels for collected packages: fbs
  Building wheel for fbs (setup.py) ... done
  Created wheel for fbs: filename=fbs-1.0.8-py3-none-any.whl size=232154 sha256=e72717e29a174fd210a348a15508c340a2843b1570f6e29614910bbcc4d0c2fd
  Stored in directory: /root/.cache/pip/wheels/32/1f/10/e129de98ae3786088e3e3da7358358715d1f3406d525795346
Successfully built fbs
Installing collected packages: pyinstaller-hooks-contrib, PyInstaller, fbs
  Attempting uninstall: PyInstaller
    Found existing installation: PyInstaller 3.4
    Uninstalling PyInstaller-3.4:
      Successfully uninstalled PyInstaller-3.4
  Attempting uninstall: fbs
    Found existing installation: fbs 1.0.2
    Uninstalling fbs-1.0.2:
      Successfully uninstalled fbs-1.0.2
Successfully installed PyInstaller-4.7 fbs-1.0.8 pyinstaller-hooks-contrib-2021.4
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
ubuntu:WizardAssistant$ fbs freeze && fbs installer
Traceback (most recent call last):
  File "/root/.pyenv/versions/3.6.12/bin/fbs", line 8, in <module>
    sys.exit(_main())
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/__main__.py", line 17, in _main
    fbs.cmdline.main()
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/cmdline.py", line 32, in main
    fn(*args)
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/builtin_commands/__init__.py", line 151, in freeze
    freeze_ubuntu(debug=debug)
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/freeze/ubuntu.py", line 4, in freeze_ubuntu
    freeze_linux(debug)
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/freeze/linux.py", line 8, in freeze_linux
    run_pyinstaller(debug=debug)
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/site-packages/fbs/freeze/__init__.py", line 47, in run_pyinstaller
    cp = run(args, capture_output=True, text=True)
  File "/root/.pyenv/versions/3.6.12/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'
ubuntu:WizardAssistant$

Would open a PR but seems like this bug only exists in the FBS pro version of that one file.

@mherrmann if you could just let me know when the new pro version file is up so i can fetch and test that would be great.

Thanks in advance for your time.

@meramsey
Copy link
Contributor Author

it looks like maybe the pro version is counting on people using Python 3.7+ and that those args are only supported in those versions

"Note: The examples shown in this section require Python 3.7 or higher. In particular, the capture_output and text keyword arguments were added in Python 3.7 when it was released in June 2018."

I think maybe just a conditional in fbs pro to run it the old way if <= Python 3.6 else run it the new way might actually be a better fix from researching some more.

@mherrmann
Copy link
Owner

Yes, I'm sorry but fbs Pro does not support Python < 3.7. I just tried to implement your suggestion (run it in the old way for <= 3.6 and the new way otherwise). But there are other places in Pro's code base that rely on Python 3.7.

@mherrmann mherrmann changed the title FBS pro freeze fails due to subprocess unexpected args error FBS pro freeze fails on Python 3.6 due to subprocess unexpected args error Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants