Giter Site home page Giter Site logo

Comments (16)

Siecje avatar Siecje commented on May 25, 2024 2

I just tried and I get the same error. I guess there needs to be a release of fbs?

Traceback (most recent call last):
  File "C:\Users\Cody\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Cody\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Cody\Downloads\fbs-tutorial-master\fbs-tutorial-master\venv\lib\site-packages\fbs\__main__.py", line 4, in <module>
    main()
  File "C:\Users\Cody\Downloads\fbs-tutorial-master\fbs-tutorial-master\venv\lib\site-packages\fbs\cmdline.py", line 17, in main
    args.cmd()
  File "C:\Users\Cody\Downloads\fbs-tutorial-master\fbs-tutorial-master\venv\lib\site-packages\fbs\builtin_commands.py", line 35, in freeze
    freeze_windows()
  File "C:\Users\Cody\Downloads\fbs-tutorial-master\fbs-tutorial-master\venv\lib\site-packages\fbs\freeze\windows.py", line 22, in freeze_windows
    remove(path('${freeze_dir}/' + dll_name))
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\Cody\\Downloads\\fbs-tutorial-master\\fbs-tutorial-master\\target\\Tutorial\\python35.dll'

from fbs-tutorial.

rominf avatar rominf commented on May 25, 2024 1

Thank you, @mherrmann, it works with Python 3.6.

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

Thank you for letting me know Cody. Does it work for you with Python 3.5?

from fbs-tutorial.

fredrikaverpil avatar fredrikaverpil commented on May 25, 2024

I ran into this too. I fixed it like so: mherrmann/fbs#3
@Siecje can you try above mentioned fix? (it's a little cumbersome)

Note: I have not been successful in freezing using Python 3.5. Perhaps related to that I'm using conda rather than venv:

conda config --add channels conda-forge  # enable conda-forge, which offers pyqt
conda create -n pyqt5_py35 python=3.5 pyqt
activate pyqt5_py35
pip install PyInstaller==3.3.1
python -m fbs freeze

from fbs-tutorial.

fredrikaverpil avatar fredrikaverpil commented on May 25, 2024

Aha, I see. Perhaps the conda distribution of PyQt5 is not --standalone so to speak...
Some more info: https://stackoverflow.com/questions/46991632/python-3-5-2-pyqt5-to-standalone-exe

I just tried this instead, which installs PyQt 5.9 rather than 5.6:

conda create -n pyqt5_py35 python=3.5
activate pyqt5_py35
pip install -r requirements.txt
# re-installed patched fbs here...
python -m fbs run
python -m fbs freeze

Please note I have a customized fbs wheel installed... with these patches applied:

This all also works with Python 3.6.

But I don't get one single Tutorial.exe file in target. Instead I get loads of DLLs next to the Tutorial.exe file in target/Tutorial.

@mherrmann are we not supposed to end up with one single .exe file with everything baked into it on Windows?

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

I believe this issue should be resolved now that mherrmann/fbs#3 is merged.

@fredrikaverpil we want 5.9 not 5.6. I assume you mention 5.6 because fman - used to - use it? Because fman is now on Qt 5.9 as well.

And getting that many files next to Tutorial.exe is what's supposed to happen. I think I mentioned somewhere else (perhaps by email?) that PyInstaller does have a "single file" mode which in my experience leads to problems.

I'll close this issue for now because I'm pretty confident that the exception mentioned by @Siecje can no longer occur.

from fbs-tutorial.

fredrikaverpil avatar fredrikaverpil commented on May 25, 2024

@fredrikaverpil we want 5.9 not 5.6. I assume you mention 5.6 because fman - used to - use it?
Because fman is now on Qt 5.9 as well.

Yes, I agree. We want 5.9.
I only mentioned 5.6 because that's what the PySide2 and PyQt5 builds distributed on conda forge is built against.

And getting that many files next to Tutorial.exe is what's supposed to happen.

Ok! / yes, you mentioned it in an email to me :)

I guess there needs to be a release of fbs?

@Siecje seems you're right, @mherrmann needs to push a new release to pypi. But also, it would be useful if you could check the target\Tutorial directory and tell us if you see both these files or just one of them:

  • python3.dll
  • python36.dll

Since this wasn't addressed, there's a slight chance you will be seeing the same (or similar issue) with the next release.

from fbs-tutorial.

fredrikaverpil avatar fredrikaverpil commented on May 25, 2024

Just wanted to mention I'm still having issues with this line of fbs, where fbs wants to remove a python3.dll which doesn't exist:
https://github.com/mherrmann/fbs/blob/master/fbs/freeze/windows.py#L34

I'm using the Python 3.6 64-bit from Python.org and I'm following the fbs-tutorial instructions exactly, with the only exception of using PySide2 instead of PyQt5.

This is not a big problem for me personally as I'm installing fbs into a venv, just like described in the fbs-tutorial example, and so I can easily access and modify this file manually to avoid having the freeze fail. Example:

    for dll_name in python_dlls:
        dll_path = path('${freeze_dir}/%s' % dll_name)
        try:
            remove(dll_path)
        except FileNotFoundError:
            print('Warning: could not remove %s' % dll_path)
        copy(_find_on_path(dll_name), path('${freeze_dir}'))

@mherrmann I know you don't want to support edge cases, but I really think that you should put the remove call within a try/except or do a os.path.exists check before attempting to remove a file which may not exist. I can't see how this would cause any significant issues but it would prevent the freeze from failing due to attempting to remove non-existing files.

I can set up a PR if you like me to. I could either do a try/except or an existance check.

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

I'll do as you suggest @fredrikaverpil. By the way, I migrated fman from Python 3.6 to 3.5 yesterday and had horrible issues on Mac. I had to roll back the release. If you can, it might be better to stick with Python 3.5.

from fbs-tutorial.

fredrikaverpil avatar fredrikaverpil commented on May 25, 2024

Sounds great, thanks :)

I migrated fman from Python 3.6 to 3.5 yesterday
...
it might be better to stick with Python 3.5 (/PyInstaller 3.3).

Oh, so Python 3.6 seems to be a no-go at the moment?

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

Oh, so Python 3.6 seems to be a no-go at the moment?

I can't give a resounding yes to that question, because YMMV. All I know is that (on Mac) I ran into very serious issues. I would advise to use Python 3.5.

from fbs-tutorial.

rominf avatar rominf commented on May 25, 2024

I have the same error on Python 3.7.1, fbs 0.5.1, pyinstaller 3.4.

from fbs-tutorial.

mherrmann avatar mherrmann commented on May 25, 2024

@rominf okay, thank you for letting me know. For now, Python 3.7 is not yet supported. Please switch to 3.6 (preferable) or 3.5.

from fbs-tutorial.

proftc avatar proftc commented on May 25, 2024

I installed Python 3.7.7 usingbrew on a MAC and fbs worked flawlessly. However, brew now installs 3.8.2 and although fbs run works freeze no longer works and I get a page full of errors (below ).
Is there a simple way of installing 3.7.7 that will work again? I tried several things including pyvenv but each version of Python gives different and annoying errors , Any help would be much appreciated
Thanks

Traceback (most recent call last):
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/bin/pyinstaller", line 8, in
sys.exit(run())
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/main.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/main.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 784, in build
exec(text, spec_namespace)
File "", line 18, in
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/building/api.py", line 98, in init
self.postinit()
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/building/datastruct.py", line 158, in postinit
self.assemble()
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/building/api.py", line 128, in assemble
self.code_dict = {
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/building/api.py", line 129, in
key: strip_paths_in_code(code)
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/building/utils.py", line 654, in strip_paths_in_code
consts = tuple(
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/building/utils.py", line 655, in
strip_paths_in_code(const_co, new_filename)
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/building/utils.py", line 654, in strip_paths_in_code
consts = tuple(
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/building/utils.py", line 655, in
strip_paths_in_code(const_co, new_filename)
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/PyInstaller/building/utils.py", line 662, in strip_paths_in_code
return code_func(co.co_argcount, co.co_kwonlyargcount, co.co_nlocals, co.co_stacksize,
TypeError: an integer is required (got type bytes)
Traceback (most recent call last):
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/bin/fbs", line 8, in
sys.exit(_main())
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/fbs/main.py", line 17, in _main
fbs.cmdline.main()
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/fbs/cmdline.py", line 32, in main
fn(*args)
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/fbs/builtin_commands/init.py", line 114, in freeze
freeze_mac(debug=debug)
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/fbs/freeze/mac.py", line 22, in freeze_mac
run_pyinstaller(args, debug)
File "/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/fbs/freeze/init.py", line 47, in run_pyinstaller
run(args, check=True)
File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pyinstaller', '--name', 'test', '--noupx', '--log-level', 'ERROR', '--noconfirm', '--windowed', '--icon', '/Users/terry/Python/ProgramsFBS/target/Icon.icns', '--distpath', '/Users/terry/Python/ProgramsFBS/target', '--specpath', '/Users/terry/Python/ProgramsFBS/target/PyInstaller', '--workpath', '/Users/terry/Python/ProgramsFBS/target/PyInstaller', '--additional-hooks-dir', '/Users/terry/Python/VirtualEnvironments/myvenv_3_8/lib/python3.8/site-packages/fbs/freeze/hooks', '--runtime-hook', '/Users/terry/Python/ProgramsFBS/target/PyInstaller/fbs_pyinstaller_hook.py', '/Users/terry/Python/ProgramsFBS/src/main/python/main.py']' returned non-zero exit status 1.

from fbs-tutorial.

mika-data avatar mika-data commented on May 25, 2024

when using windows and python 3.6, python os.listdir does not find files INSIDE a zipfile. Try unzipping \python36.zip and renaming the directory containing the unzipped files to python36.zip

from fbs-tutorial.

proftc avatar proftc commented on May 25, 2024

I do have fbs working completely on my MAC (Mojave 10.14.6) with Python 3.7.7 installed with pyenv and using
matplotlib (matplotlib.backends.backend_qt4agg) vs 3.0.3 pip PyQt5==5.9.2 and PyInstaller==3.4

from fbs-tutorial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.