AVSystem / Anjay

C implementation of the client-side OMA LwM2M protocol
Other
188 stars 68 forks source link

Missing python package dependencies #67

Closed eabase closed 1 year ago

eabase commented 1 year ago

On this page: https://avsystem.github.io/Anjay-doc/Tools/CliLwM2MServer.html#lwm2m-testing-shell

You say:

You can start the server (from the main Anjay directory) by running ./tests/integration/framework/nsh-lwm2m/nsh_lwm2m.py with the following optional arguments...

However, trying that results in the missing python packages:

$ ./tests/integration/framework/nsh-lwm2m/nsh_lwm2m.py -h
Traceback (most recent call last):
  File "C:\mydev\pr_anjay\Anjay\tests\integration\framework\nsh-lwm2m\nsh_lwm2m.py", line 20, in <module>
    from lwm2m.server import Lwm2mServer
  File "C:\mydev\pr_anjay\Anjay\tests\integration\framework\lwm2m\server.py", line 11, in <module>
    from .messages import get_lwm2m_msg
  File "C:\mydev\pr_anjay\Anjay\tests\integration\framework\lwm2m\messages.py", line 19, in <module>
    from .senml_cbor import *
  File "C:\mydev\pr_anjay\Anjay\tests\integration\framework\lwm2m\senml_cbor.py", line 10, in <module>
    import cbor2
ModuleNotFoundError: No module named 'cbor2'

What are the packages needed to run all your python scripts?

kFYatek commented 1 year ago

Hi @eabase,

Sorry that this is not well documented.

However, you can always check out the dependencies necessary to run all tests and helper scripts by checking the Github Actions test scripts - https://github.com/AVSystem/Anjay/blob/master/.github/workflows/anjay-tests.yml also refers to some Docker images, and you can see their corresponding Dockerfiles in the tools/ci directory of the repo, e.g. https://github.com/AVSystem/Anjay/blob/master/tools/ci/ubuntu-22.04/Dockerfile

If you're asking about Python packages specifically, then you can refer to the pip3 install line for the macOS platform - so the current dependencies are sphinx sphinx-rtd-theme cbor2 aiocoap cryptography packaging requests wheel

Please note, however, that some of those may only be required for running tests or building documentation.

eabase commented 1 year ago

Hi @kFYatek

We're not using Docker, so that it's a no-go.

then you can refer to the pip3 install line for the macOS platform

Thank you, but there must be something else missing, as I keep getting import errors.

# python.exe  nsh_lwm2m.py

Traceback (most recent call last):
  File "C:\mydev\pr_anjay\Anjay\tests\integration\framework\nsh-lwm2m\nsh_lwm2m.py", line 24, in <module>
    from cbor_shell import CBORBuilderShell
  File "C:\mydev\pr_anjay\Anjay\tests\integration\framework\nsh-lwm2m\cbor_shell.py", line 13, in <module>
    import powercmd
  File "C:\mydev\pr_anjay\Anjay\tests\integration\framework\nsh-lwm2m\powercmd\powercmd\__init__.py", line 5, in <module>
    from .cmd import Cmd
  File "C:\mydev\pr_anjay\Anjay\tests\integration\framework\nsh-lwm2m\powercmd\powercmd\cmd.py", line 42, in <module>
    from prompt_toolkit import PromptSession
ModuleNotFoundError: No module named 'prompt_toolkit'
eabase commented 1 year ago

It was missing powercmd which also installs prompt-toolkit.

The following pip packages are needed:

pip install -U cbor2 aiocoap cryptography packaging wheel powercmd

(with sphinx sphinx-rtd-theme optional.)

@kFYatek Please update the requirements & documentation!