您使用哪个版本的fbs,PySide2,shiboken2和python分发Qt for Python项目?

时间:2019-11-18 17:29:59

标签: python pyinstaller pyside2 fbs

我已经尝试了许多不同的方法,但现在不确定。可能存在一些兼容性错误。 fbs教程说它可以与3.6 v的python一起使用,并且可以在3.7上出现错误。但是,当我使用3.6 v的python时,PySide2的导入失败。尝试使用PySide2的5.12.0、5.1.5、5.13.2版本,与shiboken2相同。而且我所拥有的都是相同的:

File "C:\Users\test\fbsenv\program_folder\lib\site-packages\shiboken2\__init__.py", line 27, in <module>
    from .shiboken2 import *

ImportError: DLL load failed: The specified procedure could not be found.

无论是否使用venv,在装有Windows 7(x64)的不同系统上。使用3.7 v的python可以工作,但是我无法冻结我的项目。任何项目,甚至是新的空项目,都会失败(该代码段中的文本用作剧透)

(fbsenv) F:\Programming>fbs freeze
Traceback (most recent call last):
  File "F:\Programs\Python\Python37-32\lib\runpy.py", line 193, in _run_module_a
s_main
    "__main__", mod_spec)
  File "F:\Programs\Python\Python37-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "F:\Programming\fbsenv\Scripts\pyinstaller.exe\__main__.py", line 9, in <
module>
  File "f:\programming\fbsenv\lib\site-packages\PyInstaller\__main__.py", line 1
11, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "f:\programming\fbsenv\lib\site-packages\PyInstaller\__main__.py", line 6
3, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "f:\programming\fbsenv\lib\site-packages\PyInstaller\building\build_main.
py", line 838, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'
))
  File "f:\programming\fbsenv\lib\site-packages\PyInstaller\building\build_main.
py", line 784, in build
    exec(text, spec_namespace)
  File "<string>", line 29, in <module>
  File "f:\programming\fbsenv\lib\site-packages\PyInstaller\building\api.py", li
ne 424, in __init__
    strip_binaries=self.strip, upx_binaries=self.upx,
  File "f:\programming\fbsenv\lib\site-packages\PyInstaller\building\api.py", li
ne 196, in __init__
    self.__postinit__()
  File "f:\programming\fbsenv\lib\site-packages\PyInstaller\building\datastruct.
py", line 158, in __postinit__
    self.assemble()
  File "f:\programming\fbsenv\lib\site-packages\PyInstaller\building\api.py", li
ne 273, in assemble
    pylib_name = os.path.basename(bindepend.get_python_library_path())
  File "F:\Programs\Python\Python37-32\lib\ntpath.py", line 214, in basename
    return split(p)[1]
  File "F:\Programs\Python\Python37-32\lib\ntpath.py", line 183, in split
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
  File "F:\Programming\fbsenv\Scripts\fbs-script.py", line 11, in <module>
    load_entry_point('fbs==0.8.4', 'console_scripts', 'fbs')()
  File "f:\programming\fbsenv\lib\site-packages\fbs\__main__.py", line 17, in _m
ain
    fbs.cmdline.main()
  File "f:\programming\fbsenv\lib\site-packages\fbs\cmdline.py", line 32, in mai
n
    fn(*args)
  File "f:\programming\fbsenv\lib\site-packages\fbs\builtin_commands\__init__.py
", line 120, in freeze
    freeze_windows(debug=debug)
  File "f:\programming\fbsenv\lib\site-packages\fbs\freeze\windows.py", line 18,
 in freeze_windows
    run_pyinstaller(args, debug)
  File "f:\programming\fbsenv\lib\site-packages\fbs\freeze\__init__.py", line 47
, in run_pyinstaller
    run(args, check=True)
  File "F:\Programs\Python\Python37-32\lib\subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['pyinstaller', '--name', 'Namer', '--no
upx', '--log-level', 'ERROR', '--noconfirm', '--windowed', '--icon', 'F:\\Progra
mming\\src\\main\\icons\\Icon.ico', '--distpath', 'F:\\Programming\\target', '--
specpath', 'F:\\Programming\\target\\PyInstaller', '--workpath', 'F:\\Programmin
g\\target\\PyInstaller', '--additional-hooks-dir', 'f:\\programming\\fbsenv\\lib
\\site-packages\\fbs\\freeze\\hooks', '--runtime-hook', 'F:\\Programming\\target
\\PyInstaller\\fbs_pyinstaller_hook.py', 'F:\\Programming\\src\\main\\python\\ma
in.py']' returned non-zero exit status 1.

在 “ F:\ Programs \ Python \ Python37-32 \ lib \ subprocess.py”,第487行

    with Popen(*popenargs, **kwargs) as process:
        try:
            stdout, stderr = process.communicate(input, timeout=timeout)
        except TimeoutExpired:
            process.kill()
            stdout, stderr = process.communicate()
            raise TimeoutExpired(process.args, timeout, output=stdout,
                                 stderr=stderr)
        except:  # Including KeyboardInterrupt, communicate handled that.
            process.kill()
            # We don't call process.wait() as .__exit__ does that for us.
            raise
        retcode = process.poll()
        if check and retcode:
            raise CalledProcessError(retcode, process.args,
                                     output=stdout, stderr=stderr)
    return CompletedProcess(process.args, retcode, stdout, stderr)

第二个加注在这个方块中被要求,我不知道为什么。 所以也许我使用的是错误的版本?为什么shiboken2无法在3.6上运行?许多人说,泰国的fbs可以和PySide一起工作(它可以运行,但不会冻结),但是也许我应该使用PyQt?

0 个答案:

没有答案