Pycharm Debugging - ImportError: No module named plugin

1,708 views
Skip to first unread message

Zachary Trabookis

unread,
Apr 27, 2017, 12:11:13 PM4/27/17
to General Open edX discussion, chri...@edx.org, an...@edx.org
So I've downloaded devstack `open-release/ficus.3` and I following directions https://openedx.atlassian.net/wiki/display/OpenDev/Working+with+devstack+and+PyCharm to run the Pycharm debugger against the LMS. For some reason I keep getting this error below. I cleared the /Users/{USERNAME}/Library/Caches/PyCharm2017.1/ directory and restarted Pycharm. I started a new project and even recreated the project interpreter. I see the remote files and I can even view the xblock.plugin source files in the Pycharm cache locally so all seems well.

Can you help me figure out how to debug the LMS using Pycharm?

ssh://edx...@127.0.0.1:2222/edx/app/edxapp/venvs/edxapp/bin/python -u /edx/app/edxapp/edx-platform/.pycharm_helpers/pydev/pydevd.py --multiproc --qt-support --client '0.0.0.0' --port 41150 --file ./manage.py lms runserver --settings=devstack 0.0.0.0:8000
warning: Debugger speedups using cython not found. Run '"/edx/app/edxapp/venvs/edxapp/bin/python" "/edx/app/edxapp/edx-platform/.pycharm_helpers/pydev/setup_cython.py" build_ext --inplace' to build.
pydev debugger: process 19410 is connecting

Connected to pydev debugger (build 171.4163.6)
Traceback (most recent call last):
  File "/edx/app/edxapp/edx-platform/.pycharm_helpers/pydev/pydevd.py", line 1578, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/edx/app/edxapp/edx-platform/.pycharm_helpers/pydev/pydevd.py", line 1015, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "./manage.py", line 111, in <module>
    startup = importlib.import_module(edx_args.startup)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "./lms/startup.py", line 10, in <module>
    settings.INSTALLED_APPS  # pylint: disable=pointless-statement
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "./lms/envs/devstack.py", line 6, in <module>
    from .aws import *  # pylint: disable=wildcard-import, unused-wildcard-import
  File "./lms/envs/aws.py", line 25, in <module>
    from .common import *
  File "./lms/envs/common.py", line 42, in <module>
    from xmodule.modulestore.modulestore_settings import update_module_store_settings
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/__init__.py", line 20, in <module>
    from xblock.plugin import default_select
ImportError: No module named plugin

Process finished with exit code 1

Zach

Zachary Trabookis

unread,
Apr 27, 2017, 12:16:47 PM4/27/17
to General Open edX discussion, chri...@edx.org, an...@edx.org
Also I wasn't sure why I needed to include this additional path mapping.

https://openedx.atlassian.net/wiki/display/OpenDev/Working+with+devstack+and+PyCharm

Create Debug Configuration for LMS


Click the "+" button again to add a mapping for the "/edx/src" directory
  • Specify the full path to "edx/src", e.g. "/Users/[username]/devstack/src"
  • Specify "/edx/src" for "Remote path"

Zachary Trabookis

unread,
Apr 27, 2017, 1:20:17 PM4/27/17
to General Open edX discussion, chri...@edx.org, an...@edx.org, rra...@edx.org
Andy and Robert,

Here is my Pycharm configuration. I have local path for devstack at /Users/zacharytrabookis/Dev/EducateWorkforce/Repos/open-edx/devstack






This is my local instance running LMS using paver devstack lms command.

Zach


On Thursday, April 27, 2017 at 12:11:13 PM UTC-4, Zachary Trabookis wrote:

Zachary Trabookis

unread,
Apr 27, 2017, 1:27:55 PM4/27/17
to General Open edX discussion, chri...@edx.org, an...@edx.org
I forgot to mention that I also have a Tools > Deployment > Configuration setup too. This allows for SFTP access to the remote files say if I wanted to modify the /edx/app/edxapp/lms.env.json file within Pycharm. That's the only major one off thing from the https://openedx.atlassian.net/wiki/display/OpenDev/Working+with+devstack+and+PyCharm that I forgot to mention.


Zach


On Thursday, April 27, 2017 at 12:11:13 PM UTC-4, Zachary Trabookis wrote:

Zachary Trabookis

unread,
Apr 27, 2017, 1:36:02 PM4/27/17
to General Open edX discussion, chri...@edx.org, an...@edx.org
I noticed that I had ./edx-platform/common/lib/xmodule/xmodule as another source directory for the project. I think this was an extra folder. Removing it didn't seem to remove my error though.

Zach

On Thursday, April 27, 2017 at 12:11:13 PM UTC-4, Zachary Trabookis wrote:

Zachary Trabookis

unread,
Apr 27, 2017, 2:00:07 PM4/27/17
to General Open edX discussion, chri...@edx.org, an...@edx.org
When setting up the Project Interpreter (remote) I used the following configuration rather than setting a password for the edxapp account. I'm actually using ~edxapp/.ssh/authorized_keys file and authentication seems to work just fine with the Key pair (OpenSSH).

Key pair (OpenSSH)" and specify the location of your private key file (/Users/your_user_name/.ssh/id_rsa). This may be necessary with newer versions of MacOS. In this case you will need to append your public key (/Users/your_user_name/.ssh/id_rsa.pub) to the ~edxapp/.ssh/authorized_keys2

Zach


On Thursday, April 27, 2017 at 12:11:13 PM UTC-4, Zachary Trabookis wrote:

Zachary Trabookis

unread,
Apr 27, 2017, 3:03:50 PM4/27/17
to General Open edX discussion, chri...@edx.org, an...@edx.org, rra...@edx.org
I cannot read. It looks like we wanted to Deselect the following in the run/debug LMS configuration. I had those selected. This resolved my issue. Thanks edX team :)


  • Deselect "Add content roots to PYTHONPATH".
  • Deselect "Add source roots to PYTHONPATH".




On Thursday, April 27, 2017 at 12:11:13 PM UTC-4, Zachary Trabookis wrote:
Reply all
Reply to author
Forward
0 new messages