mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
improve error message on missing modules from nominatim_api
This commit is contained in:
@@ -180,6 +180,26 @@ me@machine:planet-project$
|
|||||||
They will also emit full error messages when there is a problem with the
|
They will also emit full error messages when there is a problem with the
|
||||||
code you need to debug.
|
code you need to debug.
|
||||||
|
|
||||||
|
!!! danger
|
||||||
|
In some cases, when you make an error with your import statement, the
|
||||||
|
CLI will not give you an error but instead tell you, that the API
|
||||||
|
commands are no longer available:
|
||||||
|
|
||||||
|
me@machine: nominatim status
|
||||||
|
usage: nominatim [-h] [--version] {import,freeze,replication,special-phrases,add-data,index,refresh,admin} ...
|
||||||
|
nominatim: error: argument subcommand: invalid choice: 'status'
|
||||||
|
|
||||||
|
This happens because the CLI tool is meant to still work when the
|
||||||
|
nominatim-api package is not installed. Import errors involving
|
||||||
|
`nominatim_api` are interpreted as "package not installed".
|
||||||
|
|
||||||
|
Use the help command to find out which is the offending import that
|
||||||
|
could not be found:
|
||||||
|
|
||||||
|
me@machine: nominatim -h
|
||||||
|
... [other help text] ...
|
||||||
|
Nominatim API package not found (was looking for module: nominatim_api.xxx).
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
### FormatDispatcher
|
### FormatDispatcher
|
||||||
|
|||||||
@@ -243,7 +243,8 @@ def get_set_parser() -> CommandlineParser:
|
|||||||
raise ex
|
raise ex
|
||||||
|
|
||||||
parser.parser.epilog = \
|
parser.parser.epilog = \
|
||||||
'\n\nNominatim API package not found. The following commands are not available:'\
|
f'\n\nNominatim API package not found (was looking for module: {ex.name}).'\
|
||||||
|
'\nThe following commands are not available:'\
|
||||||
'\n export, convert, serve, search, reverse, lookup, details, status'\
|
'\n export, convert, serve, search, reverse, lookup, details, status'\
|
||||||
"\n\nRun 'pip install nominatim-api' to install the package."
|
"\n\nRun 'pip install nominatim-api' to install the package."
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user