Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pluginbase cause import error in pyvirtualdisplay: ImportError: No module named display #10

Closed
garywu opened this issue Nov 13, 2015 · 4 comments
Assignees

Comments

@garywu
Copy link

garywu commented Nov 13, 2015

from pyvirtualdisplay import Display
  File "/Users/dev/.virtualenvs/kraken-32/lib/python2.7/site-packages/pluginbase.py", line 404, in plugin_import
    fromlist, level)
  File "/Users/dev/.virtualenvs/kraken-32/lib/python2.7/site-packages/pyvirtualdisplay/__init__.py", line 1, in <module>
    from display import Display
  File "/Users/dev/.virtualenvs/kraken-32/lib/python2.7/site-packages/pluginbase.py", line 404, in plugin_import
    fromlist, level)
ImportError: No module named display
@phretor
Copy link

phretor commented Nov 19, 2015

I have a similar problem, but with another module. It seems that pluginbase is mangling with the system path in a way that some modules cannot be imported anymore.

To reproduce:

# starting with a fresh venv
(test-plb) $ pip install pluginbase
Collecting pluginbase
  Using cached pluginbase-0.3-py2-none-any.whl
Installing collected packages: pluginbase
Successfully installed pluginbase-0.3
(test-plb) $ pip install androguard
Collecting androguard
Collecting distribute (from androguard)
Requirement already satisfied (use --upgrade to upgrade): setuptools>=0.7 in ./.ve/test-plb/lib/python2.7/site-packages (from distribute->androguard)
Installing collected packages: distribute, androguard
Successfully installed androguard-3.0 distribute-0.7.3
(test-plb) $ python
Python 2.7.9 (default, Apr  2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from androguard.core.bytecodes.apk import APK
>>> import pluginbase
>>> from androguard.core.bytecodes.apk import APK
>>> # all good so far, but...
>>>
(test-plb) $ python
Python 2.7.9 (default, Apr  2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pluginbase
>>> from androguard.core.bytecodes.apk import APK
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/maggi/.ve/test-plb/local/lib/python2.7/site-packages/pluginbase.py", line 404, in plugin_import
    fromlist, level)
  File "/home/maggi/.ve/test-plb/local/lib/python2.7/site-packages/androguard/core/bytecodes/apk.py", line 19, in <module>
    from androguard.core import bytecode
  File "/home/maggi/.ve/test-plb/local/lib/python2.7/site-packages/pluginbase.py", line 404, in plugin_import
    fromlist, level)
  File "/home/maggi/.ve/test-plb/local/lib/python2.7/site-packages/androguard/core/bytecode.py", line 19, in <module>
    from xml.sax.saxutils import escape
  File "/home/maggi/.ve/test-plb/local/lib/python2.7/site-packages/pluginbase.py", line 404, in plugin_import
    fromlist, level)
  File "/usr/lib/python2.7/xml/sax/__init__.py", line 22, in <module>
    from xmlreader import InputSource
  File "/home/maggi/.ve/test-plb/local/lib/python2.7/site-packages/pluginbase.py", line 404, in plugin_import
    fromlist, level)
ImportError: No module named xmlreader

and the same holds for @garywu's case.

(test-plb) $ python
Python 2.7.9 (default, Apr  2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pluginbase
>>> from pyvirtualdisplay import Display
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/maggi/.ve/test-plb/local/lib/python2.7/site-packages/pluginbase.py", line 404, in plugin_import
    fromlist, level)
  File "/home/maggi/.ve/test-plb/local/lib/python2.7/site-packages/pyvirtualdisplay/__init__.py", line 1, in <module>
    from display import Display
  File "/home/maggi/.ve/test-plb/local/lib/python2.7/site-packages/pluginbase.py", line 404, in plugin_import
    fromlist, level)
ImportError: No module named display

but if you import pluginbase after pyvirtualdisplay, all goes smoothly.

This was referenced Nov 19, 2015
joaquinpf added a commit to joaquinpf/manga_downloader that referenced this issue Jan 4, 2016
@n3storm
Copy link

n3storm commented Feb 1, 2016

Having problems with sqlite3 and dbapi2 at coleifer/peewee#841

@pepperpepperpepper
Copy link

I'm having the same issue with xml reader as I use the boto s3 library. Seems like the problem is when a plugin imports a library that uses relative imports.

pingali added a commit to pingali/dgit that referenced this issue Mar 12, 2016
@zeroSteiner zeroSteiner self-assigned this Jun 17, 2016
@zeroSteiner
Copy link
Collaborator

This looks the same as the bug resolved in #5. I was able to reproduce it using pyvirtualdisplay==0.1 and the pre-patched version of pluginbase. It looks like the issue was already worked around in pyvirtualdisplay==0.2 but regardless this has been addressed in pluginbase as well.

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

No branches or pull requests

5 participants