Code Monkey home page Code Monkey logo

protobuf-to-dict's Issues

Dependency issue with "six"

When installing the protobuf-to-dict the installation fails with the following:

    Installed /tmp/pip-build-XJxqrR/protobuf-to-dict/protobuf-3.0.0b4-py2.7.egg
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip-build-XJxqrR/protobuf-to-dict/setup.py", line 25, in <module>
        'Topic :: Software Development :: Libraries :: Python Modules',
      File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 262, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 287, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 631, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 867, in best_match
        dist = working_set.find(req)
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 509, in find
        raise VersionConflict(dist, req)
    pkg_resources.VersionConflict: (six 1.8.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('six>=1.9'))

Manually installing six 1.9.0 before protobuf-to-dict solves the problem.

Possibly the install_requires field in setup.py should include "six==1.9.0".

See: favll/pogom#7

Patch

If I had nested messages it wouldn't work as is. I had to change the fourth line to be:

if field.type not in type_callable_map and field.type != FieldDescriptor.TYPE_MESSAGE:

I added: "and field.type != FieldDescriptor.TYPE_MESSAGE"

Cheers,
Ben

protobuf-to-dict=0.1.5 issue in RHEL machine

Hi.

Please find below details of our machine:

[root@XXX ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.8 (Santiago)

We have installed protobuf_to_dict as per the instruction of below document:
https://github.com/benhodgson/protobuf-to-dict

Installation seems fine and could see all the files of protobuf_to_dict.


[root@abi-llvm ~]$ pip install protobuf-to-dict --prefix=/opt/pro
Collecting protobuf-to-dict
Downloading https://files.pythonhosted.org/packages/58/67/5f5702d8f593ec0697a1ae53d18be71f7727155f5b221c94fcecf2bf3e6d/protobuf-to-dict-0.1.0.tar.gz
Collecting protobuf>=2.3.0 (from protobuf-to-dict)
Downloading https://files.pythonhosted.org/packages/9d/61/54c3a9cfde6ffe0ca6a1786ddb8874263f4ca32e7693ad383bd8cf935015/protobuf-3.5.2.post1-cp27-cp27mu-manylinux1_x86_64.whl (6.4MB)
100% |████████████████████████████████| 6.4MB 188kB/s
Collecting six>=1.9 (from protobuf>=2.3.0->protobuf-to-dict)
Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /opt/python-setuptools/noarch/17.1.1.p2711-1/lib/python2.7/site-packages (from protobuf>=2.3.0->protobuf-to-dict)
Installing collected packages: six, protobuf, protobuf-to-dict
Running setup.py install for protobuf-to-dict ... done
Successfully installed protobuf-3.5.2.post1 protobuf-to-dict-0.1.0 six-1.11.0
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.


But when we try to import the module in python facing below issue:


[root@XXX ~]$ python
Python 2.7.11 (default, Oct 17 2016, 09:56:28)
[GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import protobuf_to_dict
Traceback (most recent call last):
File "", line 1, in
File "/opt/python-protobuf-to-dict/noarch/0.1.5.p2711/lib/python2.7/site-packages/protobuf_to_dict.py", line 1, in
from google.protobuf.message import Message
ImportError: No module named google.protobuf.message


Tried so many error fixing using google help but no luck to fix the issue.

Can anyone help me on this.

Doesn't Install on python 2.7

f-strings are used in the code and that breaks the install

Version: 0.1.0
Python: 2.7.x

      File "/tmp/easy_install-xpUITE/coverage-6.0b1/setup.py", line 116

        author=f'Ned Batchelder and {​​​​num_others}​​​​ others',

Version 0.0.5 works

Collecting protobuf-to-dict

  Using cached https://files.pythonhosted.org/packages/58/67/5f5702d8f593ec0697a1ae53d18be71f7727155f5b221c94fcecf2bf3e6d/protobuf-to-dict-0.1.0.tar.gz

    Complete output from command python setup.py egg_info:

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "/tmp/pip-build-5O0oMt/protobuf-to-dict/setup.py", line 25, in <module>

        'Topic :: Software Development :: Libraries :: Python Modules',

      File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 128, in setup

        _install_setup_requires(attrs)

      File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 123, in _install_setup_requires

        dist.fetch_build_eggs(dist.setup_requires)

      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 513, in fetch_build_eggs

        replace_conflicting=True,

      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 774, in resolve

        replace_conflicting=replace_conflicting

      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1057, in best_match

        return self.obtain(req, installer)

      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1069, in obtain

        return installer(requirement)

      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 580, in fetch_build_egg

        return cmd.easy_install(req)

      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 698, in easy_install

        return self.install_item(spec, dist.location, tmpdir, deps)

      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 724, in install_item

        dists = self.install_eggs(spec, download, tmpdir)

      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 909, in install_eggs

        return self.build_and_install(setup_script, setup_base)

      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1177, in build_and_install

        self.run_setup(setup_script, setup_base, args)

      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1163, in run_setup

        run_setup(setup_script, args)

      File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 253, in run_setup

        raise

      File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__

        self.gen.throw(type, value, traceback)

      File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context

        yield

      File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__

        self.gen.throw(type, value, traceback)

      File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 166, in save_modules

        saved_exc.resume()

      File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 141, in resume

        six.reraise(type, exc, self._tb)

      File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 154, in save_modules

        yield saved

      File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context

        yield

      File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 250, in run_setup

        _execfile(setup_script, ns)

      File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 44, in _execfile

        code = compile(script, filename, 'exec')

      File "/tmp/easy_install-xpUITE/coverage-6.0b1/setup.py", line 116

        author=f'Ned Batchelder and {​​​​num_others}​​​​ others',

                                                       ^

    SyntaxError: invalid syntax

name 'long' is not defined

python 3.8 install from pip, run import encounter name 'long' is not defined error

from protobuf_to_dict import protobuf_to_dict
NameError Traceback (most recent call last)
in
----> 1 from protobuf_to_dict import protobuf_to_dict

~/miniconda3/envs/UDL-rtwr/lib/python3.8/site-packages/protobuf_to_dict.py in
13 FieldDescriptor.TYPE_FLOAT: float,
14 FieldDescriptor.TYPE_INT32: int,
---> 15 FieldDescriptor.TYPE_INT64: long,
16 FieldDescriptor.TYPE_UINT32: int,
17 FieldDescriptor.TYPE_UINT64: long,

NameError: name 'long' is not defined

error: legacy-install-failure

Attempt to install with pip install protobuf-to-dict or python setup.py install . results to:

pip install protobuf-to-dict
Looking in indexes: https://artifact.intuit.com/artifactory/api/pypi/pypi-intuit/simple, https://artifact.intuit.com/artifactory/api/pypi/pypi-local-data-science/simple, https://pypi.python.org/simple
Collecting protobuf-to-dict
  Downloading protobuf-to-dict-0.1.0.tar.gz (2.8 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: protobuf>=2.3.0 in ./.pyenv/versions/3.8.9/lib/python3.8/site-packages (from protobuf-to-dict) (3.19.4)
Building wheels for collected packages: protobuf-to-dict
  Building wheel for protobuf-to-dict (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [30 lines of output]
      /Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/rr/sq0vmrlj1zl_4dnmclwghwy40000gn/T/pip-install-1mpxzaji/protobuf-to-dict_d9d1d99a78824f77942d56b95a2605ce/setup.py", line 3, in <module>
          setup(
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/__init__.py", line 86, in setup
          _install_setup_requires(attrs)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/dist.py", line 875, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/pkg_resources/__init__.py", line 789, in resolve
          dist = best[req.key] = env.best_match(
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1075, in best_match
          return self.obtain(req, installer)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1087, in obtain
          return installer(requirement)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/wheel.py", line 96, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/wheel.py", line 104, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/wheel.py", line 148, in _convert_metadata
          os.rename(dist_info, egg_info)
      OSError: [Errno 66] Directory not empty: '/private/var/folders/rr/sq0vmrlj1zl_4dnmclwghwy40000gn/T/pip-install-1mpxzaji/protobuf-to-dict_d9d1d99a78824f77942d56b95a2605ce/.eggs/coverage-7.0.5-py3.8-macosx-11.3-x86_64.egg/coverage-7.0.5.dist-info' -> '/private/var/folders/rr/sq0vmrlj1zl_4dnmclwghwy40000gn/T/pip-install-1mpxzaji/protobuf-to-dict_d9d1d99a78824f77942d56b95a2605ce/.eggs/coverage-7.0.5-py3.8-macosx-11.3-x86_64.egg/EGG-INFO'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for protobuf-to-dict
  Running setup.py clean for protobuf-to-dict
  error: subprocess-exited-with-error

  × python setup.py clean did not run successfully.
  │ exit code: 1
  ╰─> [30 lines of output]
      /Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/rr/sq0vmrlj1zl_4dnmclwghwy40000gn/T/pip-install-1mpxzaji/protobuf-to-dict_d9d1d99a78824f77942d56b95a2605ce/setup.py", line 3, in <module>
          setup(
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/__init__.py", line 86, in setup
          _install_setup_requires(attrs)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/dist.py", line 875, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/pkg_resources/__init__.py", line 789, in resolve
          dist = best[req.key] = env.best_match(
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1075, in best_match
          return self.obtain(req, installer)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1087, in obtain
          return installer(requirement)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/wheel.py", line 96, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/wheel.py", line 104, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/wheel.py", line 148, in _convert_metadata
          os.rename(dist_info, egg_info)
      OSError: [Errno 66] Directory not empty: '/private/var/folders/rr/sq0vmrlj1zl_4dnmclwghwy40000gn/T/pip-install-1mpxzaji/protobuf-to-dict_d9d1d99a78824f77942d56b95a2605ce/.eggs/coverage-7.0.5-py3.8-macosx-11.3-x86_64.egg/coverage-7.0.5.dist-info' -> '/private/var/folders/rr/sq0vmrlj1zl_4dnmclwghwy40000gn/T/pip-install-1mpxzaji/protobuf-to-dict_d9d1d99a78824f77942d56b95a2605ce/.eggs/coverage-7.0.5-py3.8-macosx-11.3-x86_64.egg/EGG-INFO'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed cleaning build dir for protobuf-to-dict
Failed to build protobuf-to-dict
Installing collected packages: protobuf-to-dict
  Running setup.py install for protobuf-to-dict ... error
  error: subprocess-exited-with-error

  × Running setup.py install for protobuf-to-dict did not run successfully.
  │ exit code: 1
  ╰─> [30 lines of output]
      /Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/rr/sq0vmrlj1zl_4dnmclwghwy40000gn/T/pip-install-1mpxzaji/protobuf-to-dict_d9d1d99a78824f77942d56b95a2605ce/setup.py", line 3, in <module>
          setup(
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/__init__.py", line 86, in setup
          _install_setup_requires(attrs)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/dist.py", line 875, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/pkg_resources/__init__.py", line 789, in resolve
          dist = best[req.key] = env.best_match(
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1075, in best_match
          return self.obtain(req, installer)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1087, in obtain
          return installer(requirement)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/wheel.py", line 96, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/wheel.py", line 104, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Users/iangelov/.pyenv/versions/3.8.9/lib/python3.8/site-packages/setuptools/wheel.py", line 148, in _convert_metadata
          os.rename(dist_info, egg_info)
      OSError: [Errno 66] Directory not empty: '/private/var/folders/rr/sq0vmrlj1zl_4dnmclwghwy40000gn/T/pip-install-1mpxzaji/protobuf-to-dict_d9d1d99a78824f77942d56b95a2605ce/.eggs/coverage-7.0.5-py3.8-macosx-11.3-x86_64.egg/coverage-7.0.5.dist-info' -> '/private/var/folders/rr/sq0vmrlj1zl_4dnmclwghwy40000gn/T/pip-install-1mpxzaji/protobuf-to-dict_d9d1d99a78824f77942d56b95a2605ce/.eggs/coverage-7.0.5-py3.8-macosx-11.3-x86_64.egg/EGG-INFO'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> protobuf-to-dict

note: This is an issue with the package mentioned above, not pip.

Doesn't convert ZERO value of enum and False of boolean

enum SomeType {
ZERO_VALUE = 0;
ONE_VALUE = 1;
}

message Test {
SomeType type = 1;
bool is_test = 2;
}

If we try to covert Test object with values SomeType.ZERO_VALUE and is_test is false from protobuf, then our dict will be empty

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.