https://github.com/WikiNeo/ldoce5viewer-pyside6
https://github.com/ciscorn/ldoce5viewer
https://github.com/purboo/ldoce5viewer-pyqt5
https://github.com/mike4420/ldoce5viewer-pyqt5
Когда я запускаю команду
Код: Выделить всё
python ldoce5viewer.py
Код: Выделить всё
C:\my-document\firefox-download\my-code\ldoce5viewer-pyqt5>python ldoce5viewer.py
Traceback (most recent call last):
File "ldoce5viewer.py", line 5, in
from ldoce5viewer import qtgui
File "C:\my-document\firefox-download\my-code\ldoce5viewer-pyqt5\ldoce5viewer\qtgui\__init__.py", line 10, in
import sip
ModuleNotFoundError: No module named 'sip'
C:\my-document\firefox-download\my-code\ldoce5viewer-pyqt5>
Код: Выделить всё
C:\my-document\firefox-download\my-code\ldoce5viewer-pyqt5>pip install sip
Requirement already satisfied: sip in c:\users\sky\appdata\local\programs\python\python38\lib\site-packages (6.8.6)
Requirement already satisfied: packaging in c:\users\sky\appdata\local\programs\python\python38\lib\site-packages (from sip) (24.2)
Requirement already satisfied: setuptools in c:\users\sky\appdata\local\programs\python\python38\lib\site-packages (from sip) (75.3.4)
Requirement already satisfied: tomli in c:\users\sky\appdata\local\programs\python\python38\lib\site-packages (from sip) (2.4.0)
C:\my-document\firefox-download\my-code\ldoce5viewer-pyqt5>
Но когда я запускаю команду снова, я все равно получаю подсказку об ошибке:
Код: Выделить всё
C:\my-document\firefox-download\my-code\ldoce5viewer-pyqt5>python ldoce5viewer.py
Traceback (most recent call last):
File "ldoce5viewer.py", line 5, in
from ldoce5viewer import qtgui
File "C:\my-document\firefox-download\my-code\ldoce5viewer-pyqt5\ldoce5viewer\qtgui\__init__.py", line 10, in
import sip
ModuleNotFoundError: No module named 'sip'
C:\my-document\firefox-download\my-code\ldoce5viewer-pyqt5>
Код: Выделить всё
C:\my-document\firefox-download\my-code\ldoce5viewer-pyqt5>python
Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sip
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'sip'
>>>
Согласно совету @AndrasDeak--СлаваУкраїні, теперь я могу запустить приложение ldoce5viewer exe, выполнив команду python ldoce5viewer.py

Я хочу получить exe-приложение ldoce5viewer, которое можно запускать напрямую. Я использую команду python setup.py py2exe, затем получаю ошибку:
Код: Выделить всё
C:\my-document\firefox-download\my-code\ldoce5viewer-pyside6>python setup.py py2exe
USING py2exe
py2app NOT found
C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\dist.py:337: InformationOnly: Normalizing '2013.04.24' to '2013.4.24'
self.metadata.version = self._normalize_version(self.metadata.version)
running py2exe
running build_py
copying ldoce5viewer\fulltext.py -> build\lib\ldoce5viewer
copying ldoce5viewer\incremental.py -> build\lib\ldoce5viewer
copying ldoce5viewer\__init__.py -> build\lib\ldoce5viewer
...
...
...
adding license file 'LICENSE.txt'
adding license file 'COPYING.txt'
writing manifest file 'ldoce5viewer_pyside6.egg-info\SOURCES.txt'
C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\build_py.py:220: _Warning: Package 'ldoce5viewer.qtgui.ui.__pycache__' is absent from the `packages` configuration.
!!
********************************************************************************
############################
# Package would be ignored #
############################
Python recognizes 'ldoce5viewer.qtgui.ui.__pycache__' as an importable package[^1],
but it is absent from setuptools' `packages` configuration.
This leads to an ambiguous overall configuration. If you want to distribute this
package, please make sure that 'ldoce5viewer.qtgui.ui.__pycache__' is explicitly added
to the `packages` configuration field.
Alternatively, you can also rely on setuptools' discovery methods
(for example by using `find_namespace_packages(...)`/`find_namespace:`
instead of `find_packages(...)`/`find:`).
You can read more about "package discovery" on setuptools documentation page:
- https://setuptools.pypa.io/en/latest/userguide/package_discovery.html
If you don't want 'ldoce5viewer.qtgui.ui.__pycache__' to be distributed and are
already explicitly excluding 'ldoce5viewer.qtgui.ui.__pycache__' via
`find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
you can try to use `exclude_package_data`, or `include-package-data=False` in
combination with a more fine grained `package-data` configuration.
You can read more about "package data files" on setuptools documentation page:
- https://setuptools.pypa.io/en/latest/userguide/datafiles.html
[^1]: For Python, any directory (with suitable naming) can be imported,
even if it does not contain any `.py` files.
On the other hand, currently there is no concept of package data
directory, all directories are treated like packages.
********************************************************************************
!!
check.warn(importable)
copying ldoce5viewer\static\documents\about.html -> build\lib\ldoce5viewer\static\documents
copying ldoce5viewer\static\images\external-hover.png -> build\lib\ldoce5viewer\static\images
...
...
...
copying ldoce5viewer\static\scripts\colorbox\images\loading.gif -> build\lib\ldoce5viewer\static\scripts\colorbox\images
running build_scripts
Analyzing the code
Traceback (most recent call last):
File "setup.py", line 118, in
setup(
File "C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\__init__.py", line 117, in setup
return distutils.core.setup(**attrs)
File "C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\_distutils\core.py", line 183, in setup
return run_commands(dist)
File "C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\_distutils\core.py", line 199, in run_commands
dist.run_commands()
File "C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\_distutils\dist.py", line 954, in run_commands
self.run_command(cmd)
File "C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\dist.py", line 999, in run_command
super().run_command(command)
File "C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
cmd_obj.run()
File "C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\py2exe\distutils_buildexe.py", line 204, in run
self._run()
File "C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\py2exe\distutils_buildexe.py", line 284, in _run
builder.analyze()
File "C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\py2exe\runtime.py", line 180, in analyze
mf.import_hook(modname)
File "C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\py2exe\vendor\modulefinder.py", line 215, in import_hook
q, tail = self.find_head_package(parent, name)
File "C:\Users\sky\AppData\Local\Programs\Python\Python38\lib\site-packages\py2exe\vendor\modulefinder.py", line 286, in find_head_package
raise ImportError("No module named " + qname)
ImportError: No module named sip
C:\my-document\firefox-download\my-code\ldoce5viewer-pyside6>
Код: Выделить всё
C:\my-document\firefox-download\my-code\ldoce5viewer-pyside6>pip install sip
Requirement already satisfied: sip in c:\users\sky\appdata\local\programs\python\python38\lib\site-packages (6.8.6)
Requirement already satisfied: packaging in c:\users\sky\appdata\local\programs\python\python38\lib\site-packages (from sip) (24.2)
Requirement already satisfied: setuptools in c:\users\sky\appdata\local\programs\python\python38\lib\site-packages (from sip) (75.3.4)
Requirement already satisfied: tomli in c:\users\sky\appdata\local\programs\python\python38\lib\site-packages (from sip) (2.4.0)
C:\my-document\firefox-download\my-code\ldoce5viewer-pyside6>
Как я могу решить проблему «Нет модуля с именем 'sip'»?>
Подробнее здесь: https://stackoverflow.com/questions/799 ... ip-problem
Мобильная версия