Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing python package dependencies #67

Closed
eabase opened this issue Aug 3, 2023 · 3 comments
Closed

Missing python package dependencies #67

eabase opened this issue Aug 3, 2023 · 3 comments

Comments

@eabase
Copy link

eabase commented Aug 3, 2023

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
Copy link
Contributor

kFYatek commented Aug 4, 2023

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
Copy link
Author

eabase commented Aug 7, 2023

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
Copy link
Author

eabase commented Aug 7, 2023

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!

@eabase eabase closed this as completed Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants