main
main copied to clipboard
No module named google.protobuf.descriptor
- python 2.7.13 installed and pip install gmusicapi (all dependencies installed)
- 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 !
Noone ? I'm willing to pay for resolving this issue, please contact me ! :) I believe gmusicapi could work with IronPython...
Are you able to use google-protobuf in a kind of sample script? For example using the interpreter?
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...
but it works with python.exe
Ok, but the the package is in c:\python27\lib\site-packages?
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...

here my directory structure...
my apologize, wrong image, here is correct one :)

Does that directory only contain .pyc files for the module? IronPython doesn't support .pyc files (precompiled python bytecode).
it contains .py for every .pyc....
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
thanks slozier for the investigation... but what does it mean ? i'm quite new to IronPython, what can i do with it ?
@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...
ok, are there any chances it will be fixed (soon) ? :)
@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.
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... :(
@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).
@radek673 you're welcome to debug and submit a fix yourself.
creating an empty init.py in
I think the condition could be fooled in IronPython sources if the file is missing...