bundesAPI / deutschland

Die wichtigsten APIs Deutschlands in einem Python Paket.
Apache License 2.0
1.23k stars 67 forks source link

Can't get 0.3.0 running #65

Closed HeinrichHaller closed 2 years ago

HeinrichHaller commented 2 years ago

After fresh virtualenv install via: pipenv install git+https://github.com/bundesAPI/deutschland.git#egg=deutschland I get: Python 3.9.5 (default, Nov 23 2021, 15:27:38) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import deutschland as de from deutschland import Geo Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'Geo' from 'deutschland' (unknown location) geo = Geo() Traceback (most recent call last): File "", line 1, in NameError: name 'Geo' is not defined data = geo.fetch([52.530116236589244, 13.426532801586827], ... [52.50876180448243, 13.359631043007212]) Traceback (most recent call last): File "", line 1, in NameError: name 'geo' is not defined

Similar problem with google collab(python3.7): !pip install deutschland I get the folowing:

Attempting uninstall: urllib3 Found existing installation: urllib3 1.24.3 Uninstalling urllib3-1.24.3: Successfully uninstalled urllib3-1.24.3 Attempting uninstall: requests Found existing installation: requests 2.23.0 Uninstalling requests-2.23.0: Successfully uninstalled requests-2.23.0 Attempting uninstall: regex Found existing installation: regex 2022.6.2 Uninstalling regex-2022.6.2: Successfully uninstalled regex-2022.6.2 Attempting uninstall: numpy Found existing installation: numpy 1.21.6 Uninstalling numpy-1.21.6: Successfully uninstalled numpy-1.21.6 Attempting uninstall: Pillow Found existing installation: Pillow 7.1.2 Uninstalling Pillow-7.1.2: Successfully uninstalled Pillow-7.1.2 Attempting uninstall: pandas Found existing installation: pandas 1.3.5 Uninstalling pandas-1.3.5: Successfully uninstalled pandas-1.3.5 Attempting uninstall: lxml Found existing installation: lxml 4.2.6 Uninstalling lxml-4.2.6: Successfully uninstalled lxml-4.2.6 Attempting uninstall: beautifulsoup4 Found existing installation: beautifulsoup4 4.6.3 Uninstalling beautifulsoup4-4.6.3: Successfully uninstalled beautifulsoup4-4.6.3 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. xarray-einstats 0.2.2 requires numpy>=1.21, but you have numpy 1.19.0 which is incompatible. tensorflow 2.8.2+zzzcolab20220527125636 requires numpy>=1.20, but you have numpy 1.19.0 which is incompatible. google-colab 1.0.0 requires requests~=2.23.0, but you have requests 2.28.1 which is incompatible. datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible. albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible. Successfully installed Pillow-8.4.0 beautifulsoup4-4.11.1 boto3-1.24.34 botocore-1.27.34 dateparser-1.1.1 de-autobahn-1.0.4 de-bundesrat-0.1.0 de-bundestag-0.1.0 de-dwd-1.0.1 de-interpol-0.1.0 de-jobsuche-0.1.0 de-ladestationen-1.0.5 de-mudab-0.1.0 de-nina-1.0.2 de-polizei-brandenburg-0.1.0 de-risikogebiete-0.1.0 de-smard-0.1.0 de-strahlenschutz-1.0.0 de-travelwarning-0.1.0 de-zoll-0.1.0 deutschland-0.3.0 gql-2.0.0 graphql-core-2.3.2 jmespath-1.0.1 lxml-4.9.1 mapbox-vector-tile-1.2.1 numpy-1.19.0 onnxruntime-1.10.0 pandas-1.1.5 pyclipper-1.3.0.post3 pypresseportal-0.1 regex-2022.3.2 requests-2.28.1 rx-1.6.1 s3transfer-0.6.0 slugify-0.0.1 urllib3-1.26.10

WARNING: The following packages were previously imported in this runtime: [PIL,numpy] You must restart the runtime in order to use newly installed versions.

import deutschland as de geo = de.Geo() AttributeError Traceback (most recent call last)

in () 1 import deutschland as de ----> 2 geo = de.Geo() AttributeError: module 'deutschland' has no attribute 'Geo'

Running an older version: deutschland = "==0.1.9" I don't get the import errors in Geo() but an empy result:

Python 3.9.13 (main, May 23 2022, 22:01:06) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.

from deutschland import Geo geo = Geo() data = geo.fetch([52.530116236589244, 13.426532801586827], ... [52.50876180448243, 13.359631043007212]) print(data.keys()) dict_keys([])

With the Bundesanzeiger I get the import error again:

from deutschland import Bundesanzeiger ba = Bundesanzeiger() 2022-07-22 00:09:52.683533: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2022-07-22 00:09:52.683555: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. Traceback (most recent call last): File "", line 1, in File "/home/moritz/.local/share/virtualenvs/deutschland-fqErnsp1/lib/python3.9/site-packages/deutschland/bundesanzeiger/bundesanzeiger.py", line 47, in init self.model = deutschland.bundesanzeiger.model.load_model() File "/home/moritz/.local/share/virtualenvs/deutschland-fqErnsp1/lib/python3.9/site-packages/deutschland/bundesanzeiger/model.py", line 36, in load_model return keras.models.load_model( File "/home/moritz/.local/share/virtualenvs/deutschland-fqErnsp1/lib/python3.9/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler raise e.with_traceback(filtered_tb) from None File "/home/moritz/.local/share/virtualenvs/deutschland-fqErnsp1/lib/python3.9/site-packages/keras/saving/save.py", line 206, in load_model raise IOError(f'No file or directory found at {filepath_str}') OSError: No file or directory found at assets/model.h5 data = ba.get_reports("Deutsche Bahn AG") Traceback (most recent call last): File "", line 1, in NameError: name 'ba' is not defined

Could you point to what I am doing wrong? Best regards

sesom42 commented 2 years ago

Same here after installing as normal user.

$ pip install deutschland
Collecting deutschland
  Using cached deutschland-0.3.0-py3-none-any.whl (16.1 MB)
Collecting requests<3.0.0,>=2.26.0
  Using cached requests-2.28.1-py3-none-any.whl (62 kB)
Collecting de-polizei-brandenburg<0.2.0,>=0.1.0
  Using cached de_polizei_brandenburg-0.1.0-py3-none-any.whl (67 kB)
Collecting de-autobahn<2.0.0,>=1.0.4
  Using cached de_autobahn-1.0.4-py3-none-any.whl (112 kB)
Collecting boto3<2.0.0,>=1.18.9
  Using cached boto3-1.24.35-py3-none-any.whl (132 kB)
Collecting lxml<5.0.0,>=4.6.3
  Using cached lxml-4.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (7.0 MB)
Collecting pandas==1.1.5
  Using cached pandas-1.1.5-cp39-cp39-manylinux1_x86_64.whl (9.3 MB)
Collecting onnxruntime<2.0.0,>=1.10.0
  Using cached onnxruntime-1.12.0-cp39-cp39-manylinux_2_27_x86_64.whl (4.9 MB)
Collecting de-nina<2.0.0,>=1.0.1
  Using cached de_nina-1.0.2-py3-none-any.whl (81 kB)
Collecting de-jobsuche<0.2.0,>=0.1.0
  Using cached de_jobsuche-0.1.0-py3-none-any.whl (166 kB)
Collecting slugify<0.0.2,>=0.0.1
  Using cached slugify-0.0.1-py3-none-any.whl
Collecting de-travelwarning<0.2.0,>=0.1.0
  Using cached de_travelwarning-0.1.0-py3-none-any.whl (98 kB)
Collecting de-mudab<0.2.0,>=0.1.0
  Using cached de_mudab-0.1.0-py3-none-any.whl (94 kB)
Collecting de-interpol<0.2.0,>=0.1.0
  Using cached de_interpol-0.1.0-py3-none-any.whl (87 kB)
Collecting de-bundesrat<0.2.0,>=0.1.0
  Using cached de_bundesrat-0.1.0-py3-none-any.whl (40 kB)
Collecting gql<3.0.0,>=2.0.0
  Using cached gql-2.0.0-py2.py3-none-any.whl (10 kB)
Collecting mapbox-vector-tile<2.0.0,>=1.2.1
  Using cached mapbox_vector_tile-1.2.1-py2.py3-none-any.whl
Collecting pypresseportal<0.2,>=0.1
  Using cached pypresseportal-0.1-py3-none-any.whl (13 kB)
Collecting de-zoll<0.2.0,>=0.1.0
  Using cached de_zoll-0.1.0-py3-none-any.whl (85 kB)
Collecting de-dwd<2.0.0,>=1.0.1
  Using cached de_dwd-1.0.1-py3-none-any.whl (89 kB)
Collecting more-itertools<9.0.0,>=8.10.0
  Using cached more_itertools-8.13.0-py3-none-any.whl (51 kB)
Collecting numpy==1.19.0
  Using cached numpy-1.19.0-cp39-cp39-linux_x86_64.whl
Collecting dateparser<2.0.0,>=1.0.0
  Using cached dateparser-1.1.1-py2.py3-none-any.whl (288 kB)
Collecting de-ladestationen<2.0.0,>=1.0.5
  Using cached de_ladestationen-1.0.5-py3-none-any.whl (68 kB)
Collecting de-strahlenschutz<2.0.0,>=1.0.0
  Using cached de_strahlenschutz-1.0.0-py3-none-any.whl (70 kB)
Collecting Pillow<9.0.0,>=8.3.1
  Using cached Pillow-8.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
Collecting beautifulsoup4<5.0.0,>=4.9.3
  Using cached beautifulsoup4-4.11.1-py3-none-any.whl (128 kB)
Collecting Shapely<2.0.0,>=1.8.0
  Using cached Shapely-1.8.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.0 MB)
Collecting de-bundestag<0.2.0,>=0.1.0
  Using cached de_bundestag-0.1.0-py3-none-any.whl (41 kB)
Collecting de-risikogebiete<0.2.0,>=0.1.0
  Using cached de_risikogebiete-0.1.0-py3-none-any.whl (42 kB)
Collecting de-smard<0.2.0,>=0.1.0
  Using cached de_smard-0.1.0-py3-none-any.whl (49 kB)
Collecting python-dateutil>=2.7.3
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pytz>=2017.2
  Using cached pytz-2022.1-py2.py3-none-any.whl (503 kB)
Collecting soupsieve>1.2
  Using cached soupsieve-2.3.2.post1-py3-none-any.whl (37 kB)
Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in /usr/lib/python3/dist-packages (from boto3<2.0.0,>=1.18.9->deutschland) (0.10.0)
Collecting s3transfer<0.7.0,>=0.6.0
  Using cached s3transfer-0.6.0-py3-none-any.whl (79 kB)
Collecting botocore<1.28.0,>=1.27.35
  Using cached botocore-1.27.35-py3-none-any.whl (9.0 MB)
Requirement already satisfied: urllib3<1.27,>=1.25.4 in /usr/lib/python3/dist-packages (from botocore<1.28.0,>=1.27.35->boto3<2.0.0,>=1.18.9->deutschland) (1.26.5)
Collecting regex!=2019.02.19,!=2021.8.27,<2022.3.15
  Using cached regex-2022.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (763 kB)
Collecting tzlocal
  Using cached tzlocal-4.2-py3-none-any.whl (19 kB)
Collecting promise<3,>=2.3
  Using cached promise-2.3-py3-none-any.whl
Requirement already satisfied: six>=1.10.0 in /usr/lib/python3/dist-packages (from gql<3.0.0,>=2.0.0->deutschland) (1.16.0)
Collecting graphql-core<3,>=2.3.2
  Using cached graphql_core-2.3.2-py2.py3-none-any.whl (252 kB)
Collecting rx<2,>=1.6
  Using cached Rx-1.6.1-py2.py3-none-any.whl (179 kB)
Collecting pyclipper
  Using cached pyclipper-1.3.0.post3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (608 kB)
Collecting protobuf
  Using cached protobuf-4.21.3-cp37-abi3-manylinux2014_x86_64.whl (408 kB)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from mapbox-vector-tile<2.0.0,>=1.2.1->deutschland) (52.0.0)
Collecting future
  Using cached future-0.18.2-py3-none-any.whl
Collecting flatbuffers
  Using cached flatbuffers-2.0-py2.py3-none-any.whl (26 kB)
Collecting onnxruntime<2.0.0,>=1.10.0
  Using cached onnxruntime-1.11.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB)
  Using cached onnxruntime-1.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB)
  Using cached onnxruntime-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB)
Collecting charset-normalizer<3,>=2
  Using cached charset_normalizer-2.1.0-py3-none-any.whl (39 kB)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests<3.0.0,>=2.26.0->deutschland) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests<3.0.0,>=2.26.0->deutschland) (2020.6.20)
Collecting pytz-deprecation-shim
  Using cached pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl (15 kB)
Collecting tzdata
  Using cached tzdata-2022.1-py2.py3-none-any.whl (339 kB)
Installing collected packages: tzdata, python-dateutil, rx, pytz-deprecation-shim, promise, charset-normalizer, botocore, tzlocal, soupsieve, Shapely, s3transfer, requests, regex, pytz, pyclipper, protobuf, numpy, graphql-core, future, flatbuffers, slugify, pypresseportal, Pillow, pandas, onnxruntime, more-itertools, mapbox-vector-tile, lxml, gql, de-zoll, de-travelwarning, de-strahlenschutz, de-smard, de-risikogebiete, de-polizei-brandenburg, de-nina, de-mudab, de-ladestationen, de-jobsuche, de-interpol, de-dwd, de-bundestag, de-bundesrat, de-autobahn, dateparser, boto3, beautifulsoup4, deutschland
Successfully installed Pillow-8.4.0 Shapely-1.8.2 beautifulsoup4-4.11.1 boto3-1.24.35 botocore-1.27.35 charset-normalizer-2.1.0 dateparser-1.1.1 de-autobahn-1.0.4 de-bundesrat-0.1.0 de-bundestag-0.1.0 de-dwd-1.0.1 de-interpol-0.1.0 de-jobsuche-0.1.0 de-ladestationen-1.0.5 de-mudab-0.1.0 de-nina-1.0.2 de-polizei-brandenburg-0.1.0 de-risikogebiete-0.1.0 de-smard-0.1.0 de-strahlenschutz-1.0.0 de-travelwarning-0.1.0 de-zoll-0.1.0 deutschland-0.3.0 flatbuffers-2.0 future-0.18.2 gql-2.0.0 graphql-core-2.3.2 lxml-4.9.1 mapbox-vector-tile-1.2.1 more-itertools-8.13.0 numpy-1.19.0 onnxruntime-1.10.0 pandas-1.1.5 promise-2.3 protobuf-4.21.3 pyclipper-1.3.0.post3 pypresseportal-0.1 python-dateutil-2.8.2 pytz-2022.1 pytz-deprecation-shim-0.1.0.post0 regex-2022.3.2 requests-2.28.1 rx-1.6.1 s3transfer-0.6.0 slugify-0.0.1 soupsieve-2.3.2.post1 tzdata-2022.1 tzlocal-4.2

$ python
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from deutschland import Geo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Geo' from 'deutschland' (unknown location)
>>>
wirthual commented 2 years ago

Sieht für mich nach einem Problem mit dem Deutschland namespace aus.

Funktioniert from deutschland.geo import Geo und from deutschland.bundesanzeiger import Bundesanzeiger fuer dich?

HeinrichHaller commented 2 years ago

Vielen Dank fuer die Antwort!

Noch mal frisch mit standard ubuntu LTS, python 3.8:

Installing deutschland... Adding deutschland to Pipfile's [packages]... ✔ Installation Succeeded Pipfile.lock not found, creating... Locking [dev-packages] dependencies... Locking [packages] dependencies... Building requirements... Resolving dependencies... ✘ Locking Failed! ResolutionFailure: File "/home/moritz/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 741, in _main ResolutionFailure: resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev) ResolutionFailure: File "/home/moritz/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 702, in resolve_packages ResolutionFailure: results, resolver = resolve( ResolutionFailure: File "/home/moritz/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 684, in resolve ResolutionFailure: return resolve_deps( ResolutionFailure: File "/home/moritz/.local/lib/python3.8/site-packages/pipenv/utils.py", line 1395, in resolve_deps ResolutionFailure: results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps( ResolutionFailure: File "/home/moritz/.local/lib/python3.8/site-packages/pipenv/utils.py", line 1108, in actually_resolve_deps

ResolutionFailure: File "/home/moritz/.local/lib/python3.8/site-packages/pipenv/utils.py", line 833, in resolve ResolutionFailure: raise ResolutionFailure(message=str(e)) [pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies. First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again. Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation. Hint: try $ pipenv lock --pre if it is a pre-release dependency. ERROR: Could not find a version that matches numpy==1.19.0,>=1.15.4,>=1.21.0 (from deutschland==0.3.0->-r /tmp/pipenv3crrlqjrrequirements/pipenv-gjw6xzp5-constraints.txt (line 2)) Tried: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.0, 1.6.1, 1.6.1, 1.6.2, 1.6.2, 1.7.0, 1.7.0, 1.7.1, 1.7.1, 1.7.2, 1.7.2, 1.8.0, 1.8.0, 1.8.1, 1.8.1, 1.8.2, 1.8.2, 1.9.0, 1.9.0, 1.9.1, 1.9.1, 1.9.2, 1.9.2, 1.9.3, 1.9.3, 1.10.0.post2, 1.10.0.post2, 1.10.1, 1.10.1, 1.10.2, 1.10.2, 1.10.4, 1.10.4, 1.11.0, 1.11.0, 1.11.1, 1.11.1, 1.11.2, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 1.13.3, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.3, 1.19.3, 1.19.4, 1.19.4, 1.19.4, 1.19.5, 1.19.5, 1.19.5, 1.20.0, 1.20.0, 1.20.1, 1.20.1, 1.20.2, 1.20.2, 1.20.3, 1.20.3, 1.21.0, 1.21.0, 1.21.1, 1.21.1, 1.21.2, 1.21.2, 1.21.3, 1.21.3, 1.21.4, 1.21.4, 1.21.5, 1.21.5, 1.21.6, 1.21.6, 1.22.0, 1.22.0, 1.22.1, 1.22.1, 1.22.2, 1.22.2, 1.22.3, 1.22.3, 1.22.4, 1.22.4, 1.23.0, 1.23.0, 1.23.1, 1.23.1 Skipped pre-versions: 1.13.0rc1, 1.13.0rc2, 1.14.0rc1, 1.15.0rc1, 1.15.0rc2, 1.16.0rc1, 1.16.0rc2, 1.17.0rc1, 1.17.0rc2, 1.18.0rc1, 1.19.0rc1, 1.19.0rc2, 1.20.0rc1, 1.20.0rc1, 1.20.0rc2, 1.20.0rc2, 1.21.0rc1, 1.21.0rc1, 1.21.0rc2, 1.21.0rc2, 1.22.0rc1, 1.22.0rc1, 1.22.0rc2, 1.22.0rc2, 1.22.0rc3, 1.22.0rc3, 1.23.0rc1, 1.23.0rc1, 1.23.0rc2, 1.23.0rc2, 1.23.0rc3, 1.23.0rc3 There are incompatible versions in the resolved dependencies: numpy==1.19.0 (from deutschland==0.3.0->-r /tmp/pipenv3crrlqjrrequirements/pipenv-gjw6xzp5-constraints.txt (line 2)) numpy>=1.15.4 (from pandas==1.1.5->deutschland==0.3.0->-r /tmp/pipenv3crrlqjrrequirements/pipenv-gjw6xzp5-constraints.txt (line 2)) numpy>=1.21.0 (from onnxruntime==1.12.0->deutschland==0.3.0->-r /tmp/pipenv3crrlqjrrequirements/pipenv-gjw6xzp5-constraints.txt (line 2))

from deutschland.geo import Geo

Traceback (most recent call last): File "", line 1, in File "/home/moritz/.local/share/virtualenvs/deutschland-fqErnsp1/lib/python3.9/site-packages/deutschland/geo.py", line 4, in import mapbox_vector_tile File "/home/moritz/.local/share/virtualenvs/deutschland-fqErnsp1/lib/python3.9/site-packages/mapbox_vector_tile/init.py", line 1, in from . import encoder File "/home/moritz/.local/share/virtualenvs/deutschland-fqErnsp1/lib/python3.9/site-packages/mapbox_vector_tile/encoder.py", line 14, in from .compat import PY3, vector_tile, apply_map File "/home/moritz/.local/share/virtualenvs/deutschland-fqErnsp1/lib/python3.9/site-packages/mapbox_vector_tile/compat.py", line 7, in from .Mapbox import vector_tile_p3_pb2 File "/home/moritz/.local/share/virtualenvs/deutschland-fqErnsp1/lib/python3.9/site-packages/mapbox_vector_tile/Mapbox/vector_tile_p3_pb2.py", line 32, in _descriptor.EnumValueDescriptor( File "/home/moritz/.local/share/virtualenvs/deutschland-fqErnsp1/lib/python3.9/site-packages/google/protobuf/descriptor.py", line 755, in new _message.Message._CheckCalledFromGeneratedFile() TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

from deutschland.bundesanzeiger import Bundesanzeiger, funkioniert! Ich schaue mir spaeter den Rest an.

Ich denke aber die numpy Version im lock ist das Problem. Und bei der alten Version gab es bei geo keine Probleme mit dem namespace.

wirthual commented 2 years ago

Interessant. Ein paar Dinge die ich versuchen werde:

Für die Version Probleme würde ich Mal schauen ob poetry es schafft die dependencies aufzulösen.

Evtl. im pyproject.toml die Version von Pandas und numpy mit dem prefix ^ versehen und sehen was passiert. Evtl. auch die Version mit * ersetzen und versuchen die dependencies aufzulösen.

HeinrichHaller commented 2 years ago

Ja, das sollte den Fehler: ERROR: Could not find a version that matches numpy==1.19.0,>=1.15.4,>=1.21.0 beheben. Vielleicht kannst du die Installation und die Beispiele nochmal in einem google collab Notebook mit: !pip install deutschland testen. Denke die meisten starten so. Vielen Dank

HeinrichHaller commented 2 years ago

Hat das Aufloesen der dependencies funktioniert? Welche Kombination klappt bei dir? Vielleicht kann man diese dockern?

sesom42 commented 2 years ago

Sieht für mich nach einem Problem mit dem Deutschland namespace aus.

Funktioniert from deutschland.geo import Geo und from deutschland.bundesanzeiger import Bundesanzeiger fuer dich?

Ja. Es kommt zwar noch eine deprecated warning (siehe unten), aber wenn ich dem Hinweis folge, funktioniert es. Danke!

$ python
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from deutschland.geo import Geo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jens/.local/lib/python3.9/site-packages/deutschland/geo.py", line 4, in <module>
    import mapbox_vector_tile
  File "/home/jens/.local/lib/python3.9/site-packages/mapbox_vector_tile/__init__.py", line 1, in <module>
    from . import encoder
  File "/home/jens/.local/lib/python3.9/site-packages/mapbox_vector_tile/encoder.py", line 14, in <module>
    from .compat import PY3, vector_tile, apply_map
  File "/home/jens/.local/lib/python3.9/site-packages/mapbox_vector_tile/compat.py", line 7, in <module>
    from .Mapbox import vector_tile_p3_pb2
  File "/home/jens/.local/lib/python3.9/site-packages/mapbox_vector_tile/Mapbox/vector_tile_p3_pb2.py", line 32, in <module>
    _descriptor.EnumValueDescriptor(
  File "/home/jens/.local/lib/python3.9/site-packages/google/protobuf/descriptor.py", line 755, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
wirthual commented 2 years ago

@HeinrichHaller Ich habe es in einem Google Colab Versucht. Die python version in meinem Colab war 3.7.13

Ich habe fehler gesehen, aber die installation scheint funktioniert zu haben.

Ich habe !pip install deutschland ausgefuehrt und ueberprueft ob ich Geo verwenden kann.

from deutschland.geo import Geo

geo_obj = Geo()
data = geo_obj.fetch([52.530116236589244, 13.426532801586827],[52.50876180448243, 13.359631043007212])

print(data.keys())

Gib diesen output:

dict_keys(['Adresse', 'Barrierenlinie', 'Bauwerksflaeche', 'Bauwerkslinie', 'Bauwerkspunkt', 'Besondere_Flaeche', 'Besondere_Linie', 'Besonderer_Punkt', 'Gebaeudeflaeche', 'Gebaeudepunkt', 'Gewaesserflaeche', 'Gewaesserlinie', 'Grenze_Linie', 'Historischer_Punkt', 'Siedlungsflaeche', 'Vegetationslinie', 'Vegetationspunkt', 'Verkehrsflaeche', 'Verkehrslinie', 'Verkehrspunkt', 'Hintergrund'])

Kannst du das Colab notebook teilen das zu problemen gefuehrt hat? Dann schaue ich mir das gerne an.

Seems related to this issue.

HeinrichHaller commented 2 years ago

Vielen Dank! Hier der Link zum Notebook: https://colab.research.google.com/drive/1dJ4TZLGqZrzJ4I2pVxlflyLPuO-YDdeK?usp=sharing Bundesanzeiger und Handelsregister tun nicht, namespace sollte es nicht sein.

wirthual commented 2 years ago

Vielen Dank! Hier der Link zum Notebook: https://colab.research.google.com/drive/1dJ4TZLGqZrzJ4I2pVxlflyLPuO-YDdeK?usp=sharing Bundesanzeiger und Handelsregister tun nicht, namespace sollte es nicht sein.

Also bei dem import des handelsregisters hat sich ein typo eingeschlichen, das sollte from deutschland.handelsregister import Handelsregister heisen.

Bezueglich des Bundesanzeigers: image

HeinrichHaller commented 2 years ago

Fantastisch, Bundesanzeiger ist auch wieder online. Bundesanzeiger funktionier top. Vermutlich komplett trivial: Wie komme ich bei der Handelsregister Suche an die Suchresultate? help(hr) listet die Methoden, hr.dict nur __config. Gibt es noch eine andere Dokumentation fuer das Handelsregister?

HeinrichHaller commented 2 years ago

Fantastisch, Bundesanzeiger ist auch wieder online. Bundesanzeiger funktionier top. Vermutlich komplett trivial: Wie komme ich bei der Handelsregister Suche an die Suchresultate? help(hr) listet die Methoden, hr.dict nur __config. Gibt es noch eine andere Dokumentation fuer das Handelsregister?

Danke fuer, Deine Hilfe und sorry fuer Hijacking das issue mit dem naechsten Problem. https://github.com/bundesAPI/deutschland/issues/70 geht ja in die gleiche Richtung. res = hr.search(keywords="Deutsche Bahn Aktiengesellschaft") gibt auch nur None