Has anyone had these problems with PyCharm?
First I liked PyCharm a lot, it has a clear interface and it clearly will allow an agile development for python projects. I say 'will' because currently I don't see it as a mature product because of the following issues that keeps me from buying the IDE (as of now, because I surely want to see how the product develops):
- It doesn't have support for Pylons, however with my knowledge of setting debugging environments for Eclipse/PyDev I managed to setup a Run Configuration, however the problem is that when I put the --reload option with PasteScript. I know that the python debugger has issues with this command because PasteScript does a subprocess.Popen() and it doesn't have the ability to keep track of child processes unless you set a remote debug session which I did. In fact this same configuration allows me to debug without problems in Eclipse/PyDev (--reload option + Remote Debugging). In fact what happens in PyCharm is that the breakpoints set in yourapp/config/middleware.py:make_app are hit, but after the ServeCommand calls serve() in PasteScript the debugger seems to die (although it says connected) and any other breakpoints that you have, in a controller for example, are not hit.
- When you mark a directory as source root the IDE works as expected: you can import modules from that directory. However when you run the project it doesn't add that directory to the PYTHONPATH (or sys.path) which I think is inconsistent behavior in an IDE.
- Adding an library (egg) to the project is buggy. I added a library to the interpreter and it was added with a bang (!) and a slash (/) at the end of PYTHONPATH. For example, pycharm-debug.egg would be added as pycharm-debug.egg!/ in PYTHONPATH. So I edited the xml configuration file to remove that trailing combination and it was fixed: my imports and run configuration worked. But now that I removed the library it keeps appaering up in PYTHONPATH.
Hope to see if anyone has any insights.
Please sign in to leave a comment.
I encountered this same issue, and got no reply. I wish PyCharm would take care of this itself. We are currently using NetBeans, which does add the proper directory to PYTHONPATH on run, as suggested above. But NetBean's Python plugin is more or less moribund, and I would like to find something else for the users I support. They are researchers, not software engineers, and should not need to worry about this sort of thing.
Hello Arturo,
Thanks for your feedback on PyCharm! Please find the answers to specific
questions below:
We haven't tested the remote debugging support in this configuration; at
the moment, the supported configuration for debugging is to turn off the
auto-reload option. You're welcome to file an issue at http://youtrack.jetbrains.net/
with a detailed description of the problem, and we'll investigate if it's
possible to fix something on our side to have this working correctly.
Here it wasn't clear for us what the expected behavior should be, but it
looks like most of the users do expect us to add all the source roots to
PYTHONPATH. I've filed an issue for that:
http://youtrack.jetbrains.net/issue/PY-2626
In fact, adding the !/ in PyCharm is correct (it's needed for PyCharm to
know that it needs to look inside the egg and not treat it as a single file);
the bug is that the !/ is not removed when building the PYTHONPATH. I've
filed this as http://youtrack.jetbrains.net/issue/PY-2625
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thank you for your quick response!
I will try to emulate PasteScript when runs with --reload on a smaller script and submit it to your ticketing system. Although remote debugging is targeted to processes in other machines I do think that remote debugging must work for processes created with subprocess.Popen(). I hope this get fixed because it is the only thing that keeps me from leaving Eclipse/PyDev (as the remote debugging with this configuration does work there).
I have reported a bug with an attached project that relates to the remote debugging problem.
http://youtrack.jetbrains.net/issue/PY-2631