когда я пытался установить toga с pip install toga , он установил, но выдал ошибку:
Installed:
3 package(s) to packages.config projects
Traceback (most recent call last):
File "tools\geninterop\geninterop.py", line 292, in <module>
sys.exit(main())
File "tools\geninterop\geninterop.py", line 272, in main
python_h = preprocess_python_headers()
File "tools\geninterop\geninterop.py", line 192, in preprocess_python_headers
for line in _check_output(cmd).splitlines():
File "tools\geninterop\geninterop.py", line 41, in _check_output
output = subprocess.check_output(*args, **kwargs)
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\subprocess.py", line 389, in check_output
**kwargs).stdout
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\subprocess.py", line 466, in run
with Popen(*popenargs, **kwargs) as process:
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\subprocess.py", line 769, in __init__
restore_signals, start_new_session)
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\subprocess.py", line 1172, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\cfast\AppData\Local\Temp\pip-install-fep_tzdy\pythonnet\setup.py", line 405, in <module>
zip_safe=False,
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\command\build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "C:\Users\cfast\AppData\Local\Temp\pip-install-fep_tzdy\pythonnet\setup.py", line 191, in build_extension
subprocess.check_call([sys.executable, geninterop, interop_file])
File "c:\users\cfast\appdata\local\programs\python\python37-32\lib\subprocess.py", line 341, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['c:\\users\\cfast\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'tools\\geninterop\\geninterop.py', 'src\\runtime\
----------------------------------------
Command "c:\users\cfast\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\cfast\\AppData\\Local\\Temp\\pip-install-'\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\cfast\AppData\Local\Temp\pip-record-crjqtxre\install-record.txt --single-version-extell-fep_tzdy\pythonnet\
мой код Python:
import toga
class Freedom(toga.App):
def startup(self):
self.main_window = toga.MainWindow(self.name)
self.main_window.app = self
box = toga.Box()
self.main_window.content = box
self.main_window.show()
def main():
return Freedom('Freedom Units', 'org.pybee.freedom')
if __name__ == '__main__':
main()
но когда я запускаю свой код, он дает мне следующее:
Traceback (most recent call last):
File "c:\projects\apps\eclipse\tempCodeRunnerFile.py", line 19, in <module>
main()
File "c:\projects\apps\eclipse\tempCodeRunnerFile.py", line 16, in main
return Freedom('Freedom Units', 'org.pybee.freedom') File
"C:\Users\cfast\AppData\Local\Programs\Python\Python37-32\lib\site-
packages\toga\app.py", line 53, in __init__
self.factory = get_platform_factory(factory) File
"C:\Users\cfast\AppData\Local\Programs\Python\Python37-32\lib\site-
packages\toga\platform.py", line 42, in get_platform_factory
from toga_winforms import factoryModuleNotFoundError: No module named
'toga_winforms'
, затем я пытался установить toga_winforms с pip install toga_Winforms , но он выдал мне ту же первую ошибкуЯ пытался искать решения, но ничего не получиллюбая помощь приветствуется.