Closed InRiPa closed 3 years ago
The time_provider.py
, time_provider_advanced.py
, and time_consumer.py
scripts are relics of an older version of this library. However, you should be able to run provider_app.py
and consumer_app.py
instead
Hi, I can't get it to work. Have you tried it? I made a fresh checkout, same issue.
Steps:
git clone git@github.com:arrowhead-f/client-library-python.git
cd client-library-python/examples
python -m venv .venv
source ./venv/bin/activate
python3 ./provider_app.py
Traceback (most recent call last):
File "./provider_app.py", line 4, in <module>
import arrowhead_client.api as ar
ModuleNotFoundError: No module named 'arrowhead_client'
pip install arrowhead-client
python3 ./provider_app.py
Traceback (most recent call last):
File "./provider_app.py", line 4, in <module>
import arrowhead_client.api as ar
File "/path/to/client-library-python/examples/.venv/lib/python3.8/site-packages/arrowhead_client/api.py", line 7, in <module>
from arrowhead_client.configuration import config
File "/path/to/client-library-python/examples/.venv/lib/python3.8/site-packages/arrowhead_client/configuration.py", line 1, in <module>
from arrowhead_client.system import ArrowheadSystem
File "/path/to/client-library-python/examples/.venv/lib/python3.8/site-packages/arrowhead_client/system/__init__.py", line 1, in <module>
from .provider import ProviderSystem
File "/path/to/client-library-python/examples/.venv/lib/python3.8/site-packages/arrowhead_client/system/provider.py", line 5, in <module>
from arrowhead_client.client.core_service_forms import ServiceRegistrationForm
File "/path/to/client-library-python/examples/.venv/lib/python3.8/site-packages/arrowhead_client/client/__init__.py", line 1, in <module>
from .client_core import ArrowheadClient
File "/path/to/client-library-python/examples/.venv/lib/python3.8/site-packages/arrowhead_client/client/client_core.py", line 4, in <module>
from arrowhead_client.system import ArrowheadSystem
ImportError: cannot import name 'ArrowheadSystem' from partially initialized module 'arrowhead_client.system' (most likely due to a circular import) (/path/to/client-library-python/examples/.venv/lib/python3.8/site-packages/arrowhead_client/system/__init__.py)
Could you check which version of the package you're running with pip show arrowhead-client
?
$ pip show arrowhead-client
Name: arrowhead-client
Version: 0.2.0a2
Summary: Arrowhead client library
Home-page: https://github.com/arrowhead-f/client-library-python
Author: Jacob Nilsson
Author-email: jacob.nilsson@ltu.se
License: EPL-2.0
Location: /path/to/client-library-python/examples/.venv/lib/python3.8/site-packages
Requires: typing-extensions, gevent, requests, Flask
Required-by:
$ pip --version
pip 20.2.4
$ pip list --outdated
Package Version Latest Type
---------- ------- ------ -----
setuptools 49.2.1 50.3.2 wheel
On pypi.org version 0.2.0a2 is listed as the most recent one from 10.Nov
Then the version is correct, that's good.
This part of the traceback is confusing: from .provider import ProviderSystem
, since arrowhead_client.provider
comes from an earlier version and has since been removed. You should get an ImportError or ModuleNotFoundError at that point. Similarly, arrowhead_client/__init__.py
does not contain such an import statement.
What do you get from ls -la /path/to/client-library-python/examples/.venv/lib/python3.8/site-packages
?
$ ls -la /path/to/client-library-python/examples/.venv/lib/python3.8/site-packages
total 216
drwxr-xr-x 39 user user 880 Nov 23 15:03 .
drwxr-xr-x 3 user user 60 Nov 23 15:01 ..
drwxr-xr-x 6 user user 360 Nov 23 15:02 arrowhead_client
drwxr-xr-x 2 user user 180 Nov 23 15:02 arrowhead_client-0.2.0a2.dist-info
drwxr-xr-x 3 user user 140 Nov 23 15:02 certifi
drwxr-xr-x 2 user user 160 Nov 23 15:02 certifi-2020.11.8.dist-info
drwxr-xr-x 4 user user 860 Nov 23 15:02 chardet
drwxr-xr-x 2 user user 200 Nov 23 15:02 chardet-3.0.4.dist-info
drwxr-xr-x 3 user user 400 Nov 23 15:02 click
drwxr-xr-x 2 user user 160 Nov 23 15:02 click-7.1.2.dist-info
-rw-r--r-- 1 user user 126 Nov 23 15:01 easy_install.py
drwxr-xr-x 4 user user 440 Nov 23 15:02 flask
drwxr-xr-x 2 user user 180 Nov 23 15:02 Flask-1.1.2.dist-info
drwxr-xr-x 9 user user 1680 Nov 23 15:02 gevent
drwxr-xr-x 2 user user 220 Nov 23 15:02 gevent-20.9.0.dist-info
drwxr-xr-x 2 user user 200 Nov 23 15:02 greenlet-0.4.17.dist-info
-rwxr-xr-x 1 user user 122334 Nov 23 15:02 greenlet.cpython-38-x86_64-linux-gnu.so
drwxr-xr-x 3 user user 220 Nov 23 15:02 idna
drwxr-xr-x 2 user user 160 Nov 23 15:02 idna-2.10.dist-info
drwxr-xr-x 3 user user 260 Nov 23 15:02 itsdangerous
drwxr-xr-x 2 user user 160 Nov 23 15:02 itsdangerous-1.1.0.dist-info
drwxr-xr-x 3 user user 600 Nov 23 15:02 jinja2
drwxr-xr-x 2 user user 180 Nov 23 15:02 Jinja2-2.11.2.dist-info
drwxr-xr-x 3 user user 180 Nov 23 15:02 markupsafe
drwxr-xr-x 2 user user 160 Nov 23 15:02 MarkupSafe-1.1.1.dist-info
drwxr-xr-x 5 user user 140 Nov 23 15:03 pip
drwxr-xr-x 2 user user 200 Nov 23 15:03 pip-20.2.4.dist-info
drwxr-xr-x 5 user user 120 Nov 23 15:01 pkg_resources
drwxr-xr-x 2 user user 80 Nov 23 15:02 __pycache__
drwxr-xr-x 3 user user 420 Nov 23 15:02 requests
drwxr-xr-x 2 user user 160 Nov 23 15:02 requests-2.25.0.dist-info
drwxr-xr-x 7 user user 900 Nov 23 15:01 setuptools
drwxr-xr-x 2 user user 240 Nov 23 15:01 setuptools-49.2.1.dist-info
drwxr-xr-x 2 user user 160 Nov 23 15:02 typing_extensions-3.7.4.3.dist-info
-rw-r--r-- 1 user user 83727 Nov 23 15:02 typing_extensions.py
drwxr-xr-x 6 user user 340 Nov 23 15:02 urllib3
drwxr-xr-x 2 user user 160 Nov 23 15:02 urllib3-1.26.2.dist-info
drwxr-xr-x 6 user user 520 Nov 23 15:02 werkzeug
drwxr-xr-x 2 user user 160 Nov 23 15:02 Werkzeug-1.0.1.dist-info
drwxr-xr-x 4 user user 80 Nov 23 15:02 zope
drwxr-xr-x 2 user user 180 Nov 23 15:02 zope.event-4.5.0.dist-info
-rw-r--r-- 1 user user 529 Nov 23 15:02 zope.event-4.5.0-py3.6-nspkg.pth
drwxr-xr-x 2 user user 180 Nov 23 15:02 zope.interface-5.2.0.dist-info
-rw-r--r-- 1 user user 529 Nov 23 15:02 zope.interface-5.2.0-py3.8-nspkg.pth
Sorry, I meant ls -la /path/to/client-library-python/examples/.venv/lib/python3.8/site-packages/arrowhead_client
.
Edit: Can you also show me what's in your working directory?
ls -la /path/to/client-library-python/examples/.venv/lib/python3.8/site-packages/arrowhead_client
total 44
drwxr-xr-x 6 user user 360 Nov 24 08:15 .
drwxr-xr-x 39 user user 880 Nov 24 08:15 ..
-rw-r--r-- 1 user user 939 Nov 24 08:15 abc.py
-rw-r--r-- 1 user user 1964 Nov 24 08:15 api.py
drwxr-xr-x 3 user user 160 Nov 24 08:15 client
-rw-r--r-- 1 user user 906 Nov 24 08:15 configuration.py
-rw-r--r-- 1 user user 3697 Nov 24 08:15 core_service_forms.py
-rw-r--r-- 1 user user 2416 Nov 24 08:15 core_service_responses.py
drwxr-xr-x 3 user user 120 Nov 24 08:15 core_services
-rw-r--r-- 1 user user 1076 Nov 24 08:15 httpconsumer.py
-rw-r--r-- 1 user user 1299 Nov 24 08:15 httpprovider.py
-rw-r--r-- 1 user user 0 Nov 24 08:15 __init__.py
-rw-r--r-- 1 user user 1033 Nov 24 08:15 logs.py
drwxr-xr-x 2 user user 280 Nov 24 08:15 __pycache__
-rw-r--r-- 1 user user 2078 Nov 24 08:15 service.py
drwxr-xr-x 3 user user 140 Nov 24 08:15 system
-rw-r--r-- 1 user user 1128 Nov 24 08:15 system.py
-rw-r--r-- 1 user user 1496 Nov 24 08:15 utils.py
Ok, something must've gone wrong in the packaging process, lot's of old files are still there.
I don't know when I will have time to fix this but will try to do it as soon as possible, thanks for notifying me!
EDIT: You could try doing pip install -e .
, assuming you're in he top directory of the project. That should use the correct files while I try to fix the packaging issue.
I think I found the problem, but I can't fix it right now. Will try to have it fixed by the start of next week.
Updated the library, install works now but not all dependencies are installed automatically
I'm using the
Master
branch and trying to get the exampletime_provider_advanced.py
running. But attempting to run the provider results in anImportError
:My Setup:
Steps to reproduce:
client-library-python
and run$> python3 -m venv .venv
source .venv/bin/activate
$> pip3 install arrowhead-client
$> python3 examples/time_provider_advanced.py
Result: Traceback (most recent call last):