1. 7

Newer versions of Pycharm become more and more slow (though the UI is nicer) and so is my laptop. Have tried vscode with python support but find it less powerful and equally slow as Pycharm. Does anyone know a serious alternative to Pycharm? It doesn’t have to be free. Pycharm costs more than $200/year so we are ready to pay a similar price if the alternative is lighter and faster.

  1.  

  2. 4

    If your laptop is not sufficiently powerful to run Pycharm or Visual Studio Code, I would respectfully submit that the only thing you’ll find acceptable for speed is either emacs or vim. Both are excellent choices and offer simple code completion and refactoring facilities. Neither will be at feature parity with a full featured IDE however. (Before the Faithful rise up to smite me, I eschewed IDEs and ran fully tricked out Vim and Emacs for YEARS. The refactoring facilities available amount to the ‘rope’ library which can’t hold a candle to an IDE.)

    Barring that however, have you considered doing a bit of investigation to see why Pycharm and Visual Studio Code run unacceptably slow?

    • What platform are you using?
    • Is your laptop memory, IO, or CPU constrained?
    1. 2

      Barring that however, have you considered doing a bit of investigation to see why Pycharm and Visual Studio Code run unacceptably slow?

      Check that you don’t have any plugins enabled that you aren’t using. I haven’t had too many bad experiences with plugins for Jetbrains products, either first or third party, but it’s probably work checking.

      Also, make sure you are excluding folders that don’t need to be indexed / covered in search results. Typically you only want your own code to be included. In Node projects this would be the node_modules folder, for Python it’ll be wherever pip is installing to (this may be excluded already). You may also want to exclude any build / output / data folders that you have, too. This can really impact indexing speed (system load) and the responsiveness of search.

    2. 4

      Sublime may not have the tight integration you’d get from other IDEs, but it does have the advantage of being fast. It’s been effectively jank-free since I switched to it several years ago. If VS Code isn’t powerful enough then Sublime + plugins probably won’t be either, but I did want to at least give it a mention.

      1. 1

        Sublime (with anaconda, terminus) and use of pudb (in a separate terminal window) for stepping through code.

        Bias: This is my spare-time coding setup on a 5-6 year old laptop, feel like I’d invest in an IDE if I was writing python more regularly.

      2. 4

        A lot depends on how much “IDE” tooling you want.

        Emacs in a terminal window has been my daily editor for over 15 years, and I’ve found it perfectly capable of doing everything I need. And Emacs itself has a bit of a learning curve, but if you’re already familiar with it, the Python-specific tooling is pretty easy to pick up. I use:

        • elpy, which provides a lot of the IDE-style features, if you want them. I primarily use it for Python-aware navigation and its linting and formatting integrations.
        • flycheck is the syntax-checking backend I’m using for that.
        • blacken for auto-formatting on save.
        • magit for interacting with git.

        Here’s a guide that walks you through some Emacs basics, as well as setting up various Python-specific things.

        1. 2

          Thanks, I used to use Vim before but for relatively big projects I feel more comfortable with full-fledged IDE.

        2. 2
          1. Go through your plugins for Pycharm and cut back. I’ve had issues with Jetbrains editors (and others) where it wasn’t the editor, but some plugin I was using which was causing issues. Pare back the number of dependencies you have and remove things you’re not using. I’ve seen excessive untracked files mess with IDEs, so update your .gitignore and (WARNING: READ MANUAL BEFORE EXECUTING THIS NEXT COMMAND) git clean -xfd. If the issues are bad enough that you’re thinking of switching, I’ve had exceptional service from Jetbrains when I contact them with questions and concerns. They probably have some recommendations.
          2. vim + YouCompleteMe + syntastic is a decent “IDE”.
          3. VS Code. Cut back as many plugins as possible.
          1. 2

            I’m not into Python, but VS Code works good for Golang, so it may also work well for Python?

            1. 4

              Did you read the question? The author says that they already tried to use vscode:

              Have tried vscode with python support but find it less powerful and equally slow as Pycharm

              Nonetheless, I think that the Python support of VSCode is quite good. The Python Wiki has a list of IDEs where Spyder could be an alternative to Pycharm.

              1. 1

                Oh yes, I overlooked this sentence. But in my experience VS Code is quiet fast. Maybe it gets slower when you have a large project? Also you may can disable some addons to speed it up. (f.e. the indexing was producing a lot of load for me until I changed my config to exclude some directories with temporary data)

              2. 1

                This is what I would recommend as well. I think most of the good stuff from Pycharm can be emulated in VSCode. My second recommendation would be to learn wither emacs or vim.

              3. 2

                Do you, by chance, have very large Python files? The only time I’ve had issues with PyCharm is when a single file has been very large (~1400 lines), say https://github.com/DataBiosphere/toil/blob/master/src/toil/cwl/cwltoil.py

                With large files I think all IDEs will be slow with code intelligence.

                1. 1

                  I don’t have big Python files but the libs we use have. I feel Pycharm spends a lot of time indexing and scanning directories and doing that very often, even when there are no changes.

                  1. 2

                    This really sounds like a bug that they fixed around 2019.2 or so. Is it possible/have you tried deleting and recreating the PyCharm project files with one of the newer builds?

                    Also, while this doesn’t help you at the moment, jetBrains is redoing the entire way indexing works in a way that’ll directly avoid the issue you’re hitting and then some (https://blog.jetbrains.com/idea/2019/12/intellij-platform-roadmap-for-2020/)

                    1. 1

                      Thank for the information, will try to delete the .idea/ folder and reopen the project.

                      It’s good to know that Pycharm finally take into account our complaints! Hope they will find a solution for this issue soon.

                    2. 1

                      The code I write is open source, so I use the community version (2019.2). While I prefer VS Code for C++, I still prefer PyCharm for Python. I’m on a mac. It’s possible I got used to the slowness. I agree we could do with snappier IDEs. I suspect that, as someone else was suggesting, your best solution might be to use some of the older editors. These editors don’t slow down your raw typing when the code intelligence response is delayed. You could also start to turn off PyCharm features you don’t really use so much and see if that makes things snappier.

                      1. 1

                        I used to have the same problem with Webstorm (Jetbrains’ Javascript IDE) on my underpowered laptop. Have you tried power-saving mode? I believe it turns off all indexing, and some other more intensive features.

                        1. 1

                          Unfortunately in power saving mode all the niceties of Pycharm also go away.

                    3. 2

                      Not an answer, but FWIW I had to switch away from VSCode/VSCodium because it got to be unbearably slow on my 2015 MBPs. I switched to PyCharm, so that doesn’t really help you, but just a confirmation in case you were tempted to jump full into VSCode on the advice of commenters.

                      1. 1

                        Geany, gedit, scribes, notepad2, notepad++, pspad, ultraedit, jedit. I personally believe that the whole intelisense thing misses the point. You should question why you need it and if it is really needed or just a consequence of barroque bloated APIs. This applies even to languages like java, c++ or c#, but I digress. Most of these editors will have basic autocomplete taking the current file and in some cases the working directory as source.

                        Where they beat large IDEs is in snappiness and usability.

                        1. 1

                          LEO Outliner

                          1. 1

                            I used to have a good experience with Komodo IDE but have not used for a few years now (ironically I switched to Pycharm). Might be worth a look.

                            1. 1

                              Thanks, downloading it now. It seems a bit outdated though as the latest Python version it supports is Python 3.6.

                            2. 1

                              To be more precise, here are features I’m looking for in an IDE:

                              • auto completion (obviously) and auto-import: I like the fact that I don’t need to import module before starting using them as Pycharm will suggest it for me. For example, I can just type os.environ.get("MY_VAR") and Pycharm will help me importing the os module.

                              • code navigation works with lib: it happens quite often in Python that we need to read the source code of a library and Pycharm supports this navigation very well.

                              • Formatting done right: I find that Pycharm formatting in several languages is really nice. Not too strict but still enough to have a consistent code. I feel they optimize formatting for humans. Now that Python has black formatter which is really good, this point is rather for other languages like js, html, css. A similar feature that Pycharm gets it right is optimize import: it can remove all unused imports.

                              • debugging done right: breakpoint just works. VSCode is also really good in this regard.

                              • Find & edit: I really like the fact that I can search for something and edit the file right away in Pycharm. In Pycharm find opens a modal that I can edit the code.

                              1. 1

                                Just commit and move to VS Code. I was skeptical until about 6 months ago.

                                Just do it! You will NOT regret it.