Is there something like RStudio for Python? [closed]
Asked Answered
F

10

190

In RStudio, you can run parts of code in the code editing window, and the results appear in the console.

You can also do cool stuff like selecting whether you want everything up to the cursor to run, or everything after the cursor, or just the part that you selected, and so on. And there are hot keys for all that stuff.

It's like a step above the interactive shell in Python -- there you can use readline to go back to previous individual lines, but it doesn't have any "concept" of what a function is, a section of code, etc.

Is there a tool like that for Python? Or, do you have some sort of similar workaround that you use, say, in vim?

Foxing answered 29/11, 2011 at 4:21 Comment(6)
besides in RStudio there is support for .Rnw files which I find particular useful for creating automated pdf files. I am still looking for a good Python IDE.Directed
You get to see variables details and most importantly help file within the RstudioRobbynrobe
Eclipse PyDev, Jupyter, and Spyder/Anaconda are decent substitutes, but none of them are as easy to work with as RStudio. The code completion, shortcuts for switching areas, interactive installation of packages, tabs with repositioning of order, documentation pane, all make RStudio easier to use. Python has some huge advantages as a language, but IMHO no Python IDE is on RStudio's level.Aron
I started using Rodeo, however it is very buggy. Nothing compares to RStudio. Python will always have that weakness for data analysis and exploration until a proper IDE is made with data analysis and exploration as the primary goal.Herbertherbicide
"Eclipse PyDev, Jupyter, and Spyder/Anaconda are decent substitutes..." they are all different things, I don't understand why you pair them together. Eclipse is an IDE, Jupyter is an interactive workbook and Spyder is not even close to PyCharm or the like. Plus, none of them supports most of the features that RStudio has.Thoughtful
RStudio now supports Python: blog.rstudio.com/2018/10/09/…Hb
B
54

IPython Notebooks are awesome. Here's another, newer browser-based tool I've recently discovered: Rodeo. My impression is that it seems to better support an RStudio-like workflow.

Rodeo screenshot

Boucher answered 22/5, 2015 at 4:50 Comment(5)
Great find! IMO RStudio is the best UI for data analysis, always looking for something similar for python.Gonyea
Yhat released Rodeo 2.0 (native app not a browser tool) for Windows, Mac & Linux in 2016. It's a lot more stable than it was and has lots of new features like syntax highlighting and integrated tutorials. Definitely worth checking out if you like RStudio!Perrins
My impression in early 2017 is that Rodeo still feels like a very new project and cannot compare to RStudio in terms of features or UI customizations. And it seems quite buggy. I believe Spyder is much more mature and close to being a real RStudio alternative, but YMMV.Ethnography
Ad "native app not a browser tool": From what I can see Rodeo 2.0 uses Electron. It still is a browser tool, only it now comes with its own browser to make it feel like its a native app. (It's also worth mentioning that it comes with a dependency on NodeJS.)Mauser
The link provided seems currently (2019-03) to be outdated. I found this thread stating issues with Rodeo in general: github.com/yhat/rodeo/issues/655Debacle
G
36

spyder or install python(x,y). it is great.

If you are new to Python, you can install the free Anaconda distribution (http://continuum.io/downloads.html), which will install Spyder for you, as well as Python 2.7 and IPython. Spyder is very similar to RStudio.

Galah answered 3/7, 2012 at 1:2 Comment(2)
I've been looking for a workflow like R with a text editor for python for quite some time and spyder seems to do it. I have a text editor window and a python window. I highlight a few lines in the text editor and hit F9 and they run in the interpreter. Simple, but exactly what I was looking for.Pontoon
Spyder is great as a local equivalent of RStudio (though it lacks the easy remote browser access of the server version).Momism
D
34

Jupyter Notebook (previously known as IPython notebook) is a really cool project for interactive data manipulation in Python (and other languages, including R). It basically allows you to interactively code and document what you're doing in one interface and later on save it as a:

  • notebook (.ipynb)
  • script (a .py file including only the source code)
  • static html (and therefore pdf as well)

You can even share your notebooks online with others using the nbviewer service, where people publish whole books. Furthermore, GitHub renders your .ipynb files. You can publish your Jupyter Notebooks as reproducible research articles on Authorea. For collaborative editing by multiple users, check out Google Colab built on top of Jupyter.

Jupyter Notebook Screenshot

The default Jupyter Notebook version starts a web application locally (or you deploy it to a server) and you use it from your browser. As Ryan also mentioned in his answer, Rodeo is an interface more similar to RStudio built on top of the Jupyter kernel.

JupyterLab is a newer take on the UI allowing for more flexibility in how you edit your notebooks, control interactive widgets and even run commands in terminal emulators.

There's also a Qt console for IPython, a similar project with inline plots, which is a desktop application.

Jupyter is a normal Python package and can be installed using pip install jupyter. To get all the scientific libraries running on your computer, however, it might be easier to try the official Jupyter Docker containers. For example, assuming your notebooks are in ~/code/jupyter, you can run the container as:

docker run -it --rm -p 8888:8888 -v ~/code/jupyter:/home/jovyan/work jupyter/datascience-notebook
Danzig answered 19/6, 2012 at 15:11 Comment(7)
There is a very important difference though: people who have accounts on the machine the RStudio web server is running on, can log in into the server and use it in a "time-sharing" fashion over the same port. IPython 2.x does not support this: if you want 2 people to access it on the same server, you have to run 2 server instances on 2 different ports which does not scale easily.Gwenngwenneth
Yes, that's correct. Initial work in IPython 3.x is done to support multi-user notebooks, however.Danzig
Another key difference is the (IMHO) ridiculous format of the "notebook." In RStudio you can open a script, pass it to the interpreter, and then interact with the interpreter. The script is on one side, the interpreter on the other. Because IPython has its own format you cannot simply open a script, which if edited in a notebook is in a different format.Momism
You can import a script verbatim as a module and tinker with any variables or functions it defines inside the notebook then. In the opposite direction, you can export an IPython notebook as a .py file directly. It's not an IDE for sure, though.Danzig
@kermit666 JupyterHub (github.com/jupyter/jupyterhub) is the solution I am currently using for multi-user notebooks accessible over the Web. Works quite nicely. Recommended.Gwenngwenneth
This does not answer the OP's question, which was asking about IDE's that let you run a script one line at a time, or just on a given selection of lines. iPython / Jupyter does not do this, as far as I can tell; you can only run on a per-cell basis, not an arbitrary per-line basis. So if you have a chunk of code in a cell, you have to run ALL of it, you can't just selectively run a single line like you can in RStudio.Druse
Jupyter Notebook is nothing like RStudio, it is like Maple.Incorrect
P
24

Check out Rodeo from Yhat if you're looking for something like RStudio for Python.

Rodeo has:

  • text editor (uses Atom under the hood)
  • Vim / Emacs mode
  • an IPython console
  • autocomplete
  • docstrings
  • ability to see plots, dataframes, variables
Perrins answered 28/10, 2015 at 20:55 Comment(2)
The link provided seems currently (2019-03) to be outdated. I found this thread stating issues with Rodeo in general: github.com/yhat/rodeo/issues/655Debacle
Rodeo has been abandoned by its developer. So there are no updates on this IDE since 2017. In my opinion, Spyder is the next best thing right now.Customer
D
21

You might want to look into JupyterLab (the next generation of Jupyter Notbooks): https://github.com/jupyter/jupyterlab.

JupyterLab aims to create a more desktop-like experience on the Web.

Update: As of March 2018 JupyterLab is in beta. "The beta releases are suitable for general usage. For JupyterLab extension developers, the extension APIs will continue to evolve until the 1.0 release. Eventually, JupyterLab will replace the classic Jupyter Notebook after JupyterLab reaches 1.0."

To run Jupyter Lab as a Desktop Application, see christopherroach.com/articles/jupyterlab-desktop-app (Thanks to PatrickT).

Here's a quick preview:

enter image description here

You can arrange a notebook next to a graphical console atop a terminal that is monitoring the system, while keeping the file manager on the left:

enter image description here

For more details see: https://blog.jupyter.org/2016/07/14/jupyter-lab-alpha/ and here: http://www.techatbloomberg.com/blog/inside-the-collaboration-that-built-the-open-source-jupyterlab-project/.

Dizzy answered 25/7, 2016 at 10:38 Comment(1)
Looks nice. This opens in your browser (it's so obvious you did not mention it). I find this irritating. I'd set up a dedicated browser if I was to use this. Is there a recommended browser for jupyterlab?Demonography
I
15

Pycharm is a really decent IDE. From what I have seen so far it is the most similar to Rstudio. Another nice piece is that it allows you to install new Python libraries in a fashion similar to Rstudio (which otherwise can be a nightmare). There is now a free 'community' edition.

enter image description here

Ithyphallic answered 28/3, 2014 at 16:25 Comment(2)
I might add that it has support for jupyter/ipython files, so you could combine it with the top answer. (Not sure if that's part of the free version).Brunner
PyCharm also let's you run a selection of code too!Coda
L
7

I think it is worth while to mention that RStudio v1.1.359 Preview is released. It has terminal feature that can be used for Python.

Download is available here

Documentation is available here

Libration answered 9/9, 2017 at 16:33 Comment(0)
S
4

spyder is you need! https://code.google.com/p/spyderlib/
Spyder (previously known as Pydee) is a powerful interactive development environment for the Python language with advanced editing, interactive testing, debugging and introspection features

Sarazen answered 11/1, 2014 at 15:36 Comment(0)
T
0

For a nicer interactive shell for Python, have a look at DreamPie. It's not really an IDE though (as RStudio seems to be?)

Teets answered 29/11, 2011 at 9:30 Comment(0)
E
0

Wing IDE, and probably also other Python IDEs like PyCharm and PyDev have features like this. In Wing you can either select and execute code in the integrated Python Shell or if you're debugging something you can interact with the paused debug program in a shell (called the Debug Probe). There is also special support for matplotlib, in case you're using that, so that you can work with plots interactively.

Erubescence answered 19/4, 2013 at 0:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.