from pydev import pydevd raises "ImportError: No module named pydev"

Hello,
I have tried to run a remote debugging session. When I inserted the directive: "from pydev import pydevd" editor warned me about the unresolved reference to pydev, so I tried embedded python console. The same directive raised there the exception "ImportError: No module named pydev".

I checked my pythonpath from the console - there is one reference to pydev in sys.path:
'C:\\Program Files\\JetBrains\\PyCharm 2.6\\helpers\\pydev'
which renders to the proper path. I wonder if the whitespaces causes the problem? (PyCharm runs on Windows XP with Python 2.7 here.)
Kind regards

Edward
4 comments
Comment actions Permalink
Hi Edward! Try
import pydevd
prettyPrint();
0
Comment actions Permalink
Hi Dmitry,
I tried: editor underscores the import and warns me "no module named pydevd", embedded console accepts the import and eg. allows to print pydevd:
<module 'pydevd' from 'C:\Program Files\JetBrains\PyCharm 2.6\helpers\pydev\pydevd.pyc'>
0
Comment actions Permalink
Ah, ok.

The thing you need to do is to add pycharm-debug.egg from the root of PyCharm installation to a python path of a script you'd like to debug remotely.

Then the import statement
from pydev import pydevd
prettyPrint();

should work.
0
Comment actions Permalink
I had the directive:
sys.path.append('/home/my-user-folder/egg-folder/pycharm-debug.egg')
prettyPrint(); before the pydevd import statement. /home/my-user-folder/egg-folder/ is the path on the remote (Linux) machine. The script is available through Samba service which exposes /home/my-user-folder/; the script is in a /home/my-user-folder/script-folder/. I have also mapped /home/my-user-folder/ to the drive letter reffering to the Samba share in the script's Run Configuration. At the moment the head of the script looks like:
import sys
sys.path.append('/home/my-user-folder/egg-folder/pycharm-debug.egg')
from pydev import pydevd
pydevd.settrace('10.80.0.10', port=8000, stdoutToServer=True, stderrToServer=True)
prettyPrint(); I thought that PyCharm doesn't see the local pycharm-debug.egg on the Windows machine and that's why I still see the warning.
0

Please sign in to leave a comment.