Skip to content
This repository was archived by the owner on Sep 14, 2018. It is now read-only.

No module named google.protobuf.descriptor #1573

Open

Description

@radek673
  1. python 2.7.13 installed and pip install gmusicapi (all dependencies installed)
  2. IronPython 2.7.7 via nuget in visual studio 2015

I can use gmusicapi classes without problems when running python.exe and all is working properly.

When trying with IronPython from c#:

       var pyEngine = Python.CreateEngine();

        var paths = pyEngine.GetSearchPaths();
        paths.Add(@"c:\python27\lib");
        paths.Add(@"c:\python27\lib\site-packages");
        pyEngine.SetSearchPaths(paths);

        ScriptScope pyScope = pyEngine.CreateScope();

    pyEngine.Execute("import sys", pyScope);
        pyEngine.Execute("sys.platform = \"win32\"", pyScope);

        **// ERROR: No module named google.protobuf.descriptor
        pyEngine.Execute("from gmusicapi import Mobileclient", pyScope);**

Any help would be greatly appreciated !

Activity

  1. radek673 commented on Feb 2, 2017

    @radek673
    Author

    Noone ? I'm willing to pay for resolving this issue, please contact me ! :) I believe gmusicapi could work with IronPython...

  2. simplicbe commented on Feb 2, 2017

    @simplicbe
    Contributor

    Are you able to use google-protobuf in a kind of sample script? For example using the interpreter?

  3. radek673 commented on Feb 2, 2017

    @radek673
    Author

    just tried:
    pyEngine.Execute("from google.protobuf.message import DecodeError", pyScope);
    pyEngine.Execute("from google.protobuf.descriptor import FieldDescriptor", pyScope);

    neither of these works, same exception...

  4. radek673 commented on Feb 2, 2017

    @radek673
    Author

    but it works with python.exe

  5. simplicbe commented on Feb 2, 2017

    @simplicbe
    Contributor

    Ok, but the the package is in c:\python27\lib\site-packages?

  6. radek673 commented on Feb 2, 2017

    @radek673
    Author

    yes everything is properly installed. as i said, its working with python.exe and it is not with IronPython. so i guess the problem must be somewhere with IronPython...

  7. radek673 commented on Feb 2, 2017

    @radek673
    Author

    untitled

    here my directory structure...

  8. radek673 commented on Feb 2, 2017

    @radek673
    Author

    my apologize, wrong image, here is correct one :)

    untitled

  9. slide commented on Feb 2, 2017

    @slide
    Contributor

    Does that directory only contain .pyc files for the module? IronPython doesn't support .pyc files (precompiled python bytecode).

  10. radek673 commented on Feb 2, 2017

    @radek673
    Author

    it contains .py for every .pyc....

  11. slozier commented on Feb 2, 2017

    @slozier
    Contributor

    Doesn't look like it'll work without some work:

    >>> from gmusicapi import Mobileclient
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\gmusicapi\__init__.py", line 4, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\gmusicapi\clients\__init__.py", line 4, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\gmusicapi\clients\webclient.py", line 16, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\gmusicapi\clients\shared.py", line 7, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\gmusicapi\utils\utils.py", line 24, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\google\protobuf\__init__.py", line 37, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\pkg_resources\__init__.py", line 74, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\pkg_resources\_vendor\packaging\requirements.py", line 9, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\pkg_resources\extern\__init__.py", line 43, in load_module
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\pkg_resources\_vendor\pyparsing.py", line 4715, in <module>
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\pkg_resources\_vendor\pyparsing.py", line 1261, in setParseAction
      File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\pkg_resources\_vendor\pyparsing.py", line 1043, in _trim_arity
    IndexError: index out of range: -1
    

    This failure appears to have to do with the frame stack:

    import sys
    
    def test():
        i = 0
        try:
            raise Exception()
        except:
            f = sys.exc_info()[2].tb_frame
            while f is not None:
                i += 1
                f = f.f_back
        return i
    
    assert test() == 2
  12. radek673 commented on Feb 3, 2017

    @radek673
    Author

    thanks slozier for the investigation... but what does it mean ? i'm quite new to IronPython, what can i do with it ?

  13. slozier commented on Feb 4, 2017

    @slozier
    Contributor

    @radek673 It involves parts of the system which I'm not too familiar (frames). Other than trying to fix the C# code for frames I'm not sure if there's a workaround...

  14. radek673 commented on Feb 4, 2017

    @radek673
    Author

    ok, are there any chances it will be fixed (soon) ? :)

  15. pekkaklarck commented on Feb 6, 2017

    @pekkaklarck

    @slozier I doubt that IndexError inside pyparsing is the real root cause for this issue. It seems to be a rather sever problem, though, because it prevents me from using pip as I reported in #1572.

  16. radek673 commented on Feb 6, 2017

    @radek673
    Author

    please fix it, this is basic functionality, blocker that makes IronPython USELESS.... you cannot even use simple 3rd party library with IronPython.... only statements "a := b" are compatible... pitty... :(

  17. slozier commented on Feb 6, 2017

    @slozier
    Contributor

    @pekkaklarck I am aware there are a number of issues with pip. However, I did not mean to imply that the pyparsing failure had anything to do with pip. I was just pointing out that even we got past the installation issue that would not be the end of it (getting gmusicapi to work).

  18. slide commented on Feb 6, 2017

    @slide
    Contributor

    @radek673 you're welcome to debug and submit a fix yourself.

  19. radek673 commented on Feb 8, 2017

    @radek673
    Author

    creating an empty init.py in \Lib\site-packages\google solved the problem, sadly, there are more issues :/

    I think the condition could be fooled in IronPython sources if the file is missing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions