Open liudonghua123 opened 2 years ago
Hi! You're using the free version of fbs?
Yes, I install fbs via pip, does it matter?
It's really strange, I reinstalled fbs and then it seemed did not work on my python 3.10.
I commented the version check in init
of __init__.py
, then I got ImportError: No module named _bootlocale
in the pyinstaller process. Then I updated the pyinstaller to the latest 5.1
.
I found that when I installed fbs-tutorial
, then some fbs lib code like site-packages\fbs\builtin_commands\__init__.py
got updated or patched. Then MyFbsApp
got involved.
The original startproject
is
@command
def startproject():
"""
Start a new project in the current directory
"""
if exists('src'):
raise FbsError('The src/ directory already exists. Aborting.')
app = prompt_for_value('App name', default='MyApp')
user = getuser().title()
author = prompt_for_value('Author', default=user)
has_pyqt = _has_module('PyQt5')
has_pyside = _has_module('PySide2')
if has_pyqt and not has_pyside:
python_bindings = 'PyQt5'
elif not has_pyqt and has_pyside:
python_bindings = 'PySide2'
else:
python_bindings = prompt_for_value(
'Qt bindings', choices=('PyQt5', 'PySide2'), default='PyQt5'
)
eg_bundle_id = 'com.%s.%s' % (
author.lower().split()[0], ''.join(app.lower().split())
)
mac_bundle_identifier = prompt_for_value(
'Mac bundle identifier (eg. %s, optional)' % eg_bundle_id,
optional=True
)
mkdir('src')
template_dir = join(dirname(__file__), 'project_template')
template_path = lambda relpath: join(template_dir, *relpath.split('/'))
copy_with_filtering(
template_dir, '.', {
'app_name': app,
'author': author,
'mac_bundle_identifier': mac_bundle_identifier,
'python_bindings': python_bindings
},
files_to_filter=[
template_path('src/build/settings/base.json'),
template_path('src/build/settings/mac.json'),
template_path('src/main/python/main.py')
]
)
print('')
_LOG.info(
"Created the src/ directory. If you have %s installed, you can now "
"do:\n\n fbs run", python_bindings
)
Changed to the following.
_FIXED_APP_NAME = 'MyFbsApp'
_FIXED_AUTHOR = 'Author'
_FIXED_MAC_BUNDLE_IDENTIFIER = 'com.author.myfbsapp'
_FIXED_PYTHON_BINDINGS = 'PyQt5'
@command
def startproject():
"""
Start a new project in the current directory
"""
if exists('src'):
raise FbsError('The src/ directory already exists. Aborting.')
mkdir('src')
template_dir = join(dirname(__file__), 'project_template')
template_path = lambda relpath: join(template_dir, *relpath.split('/'))
# fbs prompts the user for several values such as the app name.
# We use hard-coded values to be able to use pre-compiled binaries.
copy_with_filtering(
template_dir, '.', {
'app_name': _FIXED_APP_NAME,
'author': _FIXED_AUTHOR,
'mac_bundle_identifier': _FIXED_MAC_BUNDLE_IDENTIFIER,
'python_bindings': _FIXED_PYTHON_BINDINGS
},
files_to_filter=[
template_path('src/build/settings/base.json'),
template_path('src/build/settings/mac.json'),
template_path('src/main/python/main.py')
]
)
print('')
_LOG.info(
"Created the src/ directory. You can now do:\n\n"
" fbs run"
)
免费版的好像不支持高版本的python
免费版的好像不支持高版本的python
嗯,也许是,我已经转向直接使用pyinstaller打包,也没想象中的麻烦,一条命令就可以,另外也不用pyqt5/6,pyside2/6了,使用flet了。
I created a directory named
statistics_app
, and usefbs startproject
to create the initial files. Then I triedfbs freeze
, The log showsDone. You can now run
target\statistics_app\statistics_app.exe. If that doesn't work, see https://build-system.fman.io/troubleshooting.
. But the actual executable generated istarget\statistics_app\MyFbsApp.exe
andfbs installer
failed with!getdllversion: error reading version info from "..\statistics_app\statistics_app.exe" Error in script "Installer.nsi" on line 6 -- aborting creation process
.