PyCharm configuration problems

1,446 views
Skip to first unread message

Juanan Pereira

unread,
Jun 29, 2014, 10:55:30 AM6/29/14
to edx-...@googlegroups.com
Hi there,


I have installed devstack in a MacOSX 10.9.3 system. I can use LMS and Studio from my browser (after sshing and doing paver devstack lms , paver devstack studio). So far, so good. The problem arises when I try to configure my system for debugging edx following this guide:


I'm using PyCharm 3.4. I have been able to follow the steps up to the point about "Configuring Remote Python interpreter". This screenshot 


on the guide states that there are two textfields on the bottom part of the dialog: 
"Python interpreter path" and "PyCharm helpers path". The fact is that in PyCharm 3.4 I can only see the first one. 


If I omit that detail, and keep on following the guide, it seems that it will work... until I click on the "Debug / LMS" button. The debugger starts but yields the following error in lms/startup.py:

ssh://edx...@127.0.0.1:2222/usr/bin/python -u /edx/app/edxapp/edx-platform/.pycharm_helpers/pydev/pydevd.py --multiproc --client '0.0.0.0' --port 51899 --file ./manage.py lms runserver --settings=devstack 0.0.0.0:8000
pydev debugger: process 2340 is connecting

Connected to pydev debugger (build 135.1057)
Traceback (most recent call last):
  File "/edx/app/edxapp/edx-platform/.pycharm_helpers/pydev/pydevd.py", line 1733, in <module>
    debugger.run(setup['file'], None, None)
  File "/edx/app/edxapp/edx-platform/.pycharm_helpers/pydev/pydevd.py", line 1226, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "./manage.py", line 90, 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 5, in <module>
    from django.conf import settings
ImportError: No module named django.conf


It seems to me that there is some more configuration tasks to be done in order to have this thing up & running.  Any help will be much appreciated.


--
Greetings,

Juanan Pereira
juanan....@ehu.es

Andy Armstrong

unread,
Jun 29, 2014, 8:36:27 PM6/29/14
to edx-...@googlegroups.com
Hi Juanan,

I wrote the original version of the debugging wiki page so let me see if I can help you. I am currently running on PyCharm 3.4 and am able to debug LMS and CMS okay. However, my interpreters were created using an earlier version, so I could imagine that there might be a problem.

I tried creating a new remote interpreter, and as you say that helpers parameter seems to no longer be an option. It does appear to be there when you edit the remote interpreter later, though, so it seems that JetBrains decided it was too confusing to ask the user for that option when first creating an interpreter.

I decided to use the 'Vagrant' option since that seems simpler. Here's what I specified:

Inline image 1

When I run LMS, I get a slightly different command than you:

ssh://vag...@127.0.0.1:2222/edx/app/edxapp/venvs/edxapp/bin/python -u /home/vagrant/.pycharm_helpers/pydev/pydevd.py --multiproc --client '0.0.0.0' --port 51981 --file /edx/app/edxapp/edx-platform/manage.py lms runserver --settings=devstack 0.0.0.0:8000

In particular, my file parameter is absolute while yours is relative. Did you maybe specify a different interpreter path? The default path of /usr/bin/python won't work as it will use the wrong virtual environment. If you did specify the correct path, then I would say try the vagrant option and see if that works for you.

Let me know how it works out, and I'll update the documentation.

Thanks,

 - Andy
--

Andy Armstrong

edX | UI Architect  | an...@edx.org  

141 Portland Street, 9th floor

Cambridge, MA 02139

http://www.edx.org

http://www.e-learn.nl/media/blogs/e-learn/edX_Logo_Col_RGB_FINAL.jpg?mtime=1336074566

Juanan Pereira

unread,
Jun 30, 2014, 7:32:13 PM6/30/14
to edx-...@googlegroups.com
Hi Andy,

  thanks for your response. It seems that I managed to incorrectly type the python interpreter path :-O
Now, following your instructions, I have defined the interpreter path to:

/edx/app/edxapp/venvs/edxapp/bin/python

and the debugger works like a charm :-)  Thanks!

--
Greetings,

Juanan Pereira

Reply all
Reply to author
Forward
0 new messages