Is there something like RStudio for Python? [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
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?

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.

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.

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.
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

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

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:
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:
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/.

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.

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

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

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

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.

Related

What is the difference between Jupyter Notebook and JupyterLab?

I am new to Jupyter Notebook, what is the key difference between the Jupyter Notebook and JupyterLab, suggest me to choose the best one, which should be used in future.
Jupyter Notebook is a web-based interactive computational environment for creating Jupyter notebook documents. It supports several languages like Python (IPython), Julia, R etc. and is largely used for data analysis, data visualization and further interactive, exploratory computing.
JupyterLab is the next-generation user interface including notebooks. It has a modular structure, where you can open several notebooks or files (e.g. HTML, Text, Markdowns etc) as tabs in the same window. It offers more of an IDE-like experience.
For a beginner I would suggest starting with Jupyter Notebook as it just consists of a filebrowser and an (notebook) editor view. It might be easier to use.
If you want more features, switch to JupyterLab. JupyterLab offers much more features and an enhanced interface, which can be extended through extensions:
JupyterLab Extensions (GitHub)
1 - To answer your question directly:
The single most important difference between the two is that you should start using JupyterLab straight away, and that you should not worry about Jupyter Notebook at all. Because:
JupyterLab will eventually replace the classic Jupyter Notebook.
Throughout this transition, the same notebook document format will be
supported by both the classic Notebook and JupyterLab
As of version 3.0, JupyterLab also comes with a visual debugger that lets you interactively set breakpoints, step into functions, and inspect variables.
2 - To contradict the numerous claims in the comments that plotly does not run well with JLab:
JupyterLab is an absolutely fantastic tool both to build plotly figures, and fire up complete Dash Apps both inline, as a tab, and externally in a browser.
3 - And you would probably also like to know this:
Other posts have suggested that Jupyter Notebook (JN) could potentially be easier to use than JupyterLab (JL) for beginners. But I would have to disagree.
A great advantage with JL, and arguably one of the most important differences between JL and JN, is that you can more easily run a single line and even highlighted text. I prefer using a keyboard shortcut for this, and assigning shortcuts is pretty straight-forward.
And the fact that you can execute code in a Python console makes JL much more fun to work with. Other answers have already mentioned this, but JL can in some ways be considered a tool to run Notebooks and more. So the way I use JupyterLab is by having it set up with an .ipynb file, a file browser and a python console like this:
And now you have these tools at your disposal:
View Files, running kernels, Commands, Notebook Tools, Open Tabs or Extension manager
Run cells using, among other options, Ctrl+Enter
Run single expression, line or highlighted text using menu options or keyboard shortcuts
Run code directly in a console using Shift+Enter
Inspect variables, dataframes or plots quickly and easily in a console without cluttering your notebook output.
At this time (mid 2019), with JupyterLab 1.0 release, as a user, I think we should adopt JupyterLab for daily use. And from the JupyterLab official documentation:
The current release of JupyterLab is suitable for general daily use.
and
JupyterLab will eventually replace the classic Jupyter Notebook. Throughout this transition, the same notebook document format will be supported by both the classic Notebook and JupyterLab.
Note that JupyterLab has a extensible modular architecture. So in the old days, there is just one Jupyter Notebook, and now with JupyterLab (and in the future), Notebook is just one of the core applications in JupyterLab (along with others like code Console, command-line Terminal, and a Text Editor).
(I am using JupyterLab with Julia)
First thing is that Jupyter lab from my previous use offers more 'themes' which is great on the eyes, and also fontsize changes independent of the browser, so that makes it closer to that of an IDE. There are some specifics I like such as changing the 'code font size' and leaving the interface font size to be the same.
Major features that are great is
the drag and drop of cells so that you can easily rearrange the code
collapsing cells with a single mouse click and a small mark to remind of their placement
What is paramount though is the ability to have split views of the tabs and the terminal. If you use Emacs, then you probably enjoyed having multiple buffers with horizontal and vertical arrangements with one of them running a shell (terminal), and with jupyterlab this can be done, and the arrangement is made with drags and drops which in Emacs is typically done with sets of commands.
(I do not believe that there is a learning curve added to those that have not used the 'notebook' original version first. You can dive straight into this IDE experience)
This answer shows the python perspective. Jupyter supports various languages besides python.
Both Jupyter Notebook and Jupyterlab are browser compatible interactive python (i.e. python ".ipynb" files) environments, where you can divide the various portions of the code into various individually executable cells for the sake of better readability. Both of these are popular in Data Science/Scientific Computing domain.
I'd suggest you to go with Jupyterlab for the advantages over Jupyter notebooks:
In Jupyterlab, you can create ".py" files, ".ipynb" files, open terminal etc. Jupyter Notebook allows ".ipynb" files while providing you the choice to choose "python 2" or "python 3".
Jupyterlab can open multiple ".ipynb" files inside a single browser tab. Whereas, Jupyter Notebook will create new tab to open new ".ipynb" files every time. Hovering between various tabs of browser is tedious, thus Jupyterlab is more helpful here.
I'd recommend using PIP to install Jupyterlab.
If you can't open a ".ipynb" file using Jupyterlab on Windows system, here are the steps:
Go to the file --> Right click --> Open With --> Choose another app --> More Apps --> Look for another apps on this PC --> Click.
This will open a file explorer window. Now go inside your Python installation folder. You should see Scripts folder. Go inside it.
Once you find jupyter-lab.exe, select that and now it will open the .ipynb files by default on your PC.
If you are looking for features that notebooks in JupyterLab have that traditional Jupyter Notebooks do not, check out the JupyterLab notebooks documentation. There is a simple video showing how to use each of the features in the documentation link.
JupyterLab notebooks have the following features and more:
Drag and drop cells to rearrange your notebook
Drag cells between notebooks to quickly copy content (since you can have more than one open at a time)
Create multiple synchronized views of a single notebook
Themes and customizations: Dark theme and increase code font size

SublimeREPL for IPython under Windows not possible. Any workaround?

SublimeREPL says 'IPython doesn't work under SublimeREPL on Windows' when I select Ipython from it.
Is there any solution out there for this great plugin to work with IPython on Windows as well.
tl;dr: try master branch from github. If something doesn't work, get in touch with me (github issues), I'll try to help:)
Hi everyone,
there is no need for such heated discussion :) SublimeREPL is in a bit of a transitional state right now. Development is progressing steadily (https://github.com/wuub/SublimeREPL/commits/master) with most of my personal focus on Python/IPython.
However there was no release to Package Control for some time now, since I switched to Sublime Text 3 and Linux in march. This is mostly because ST2 (python2) -> St3 (python3) port dropped some functions, and compatibility with OSX & Windows isn't 'production ready' yet. I'm afraid to release current code to everyone, as it'll most definitely not work for some people.
To cut the long story short. SublimeREPL version available in Package Control is stable but out of date. SublimeREPL from git master is used daily by me and several other people, but I test it only on Linux.
Will Bond is planning to roll out new version of Package Control soon (https://twitter.com/wbond/status/334753348018388992). It will allow me to target specific versions of SublieText with different code, and roll out new code separately for compatible platforms.
On a related note: SublimePTY was not updated for a very long time and its future is uncertain at best.
If you haven't made any changes to config files within the Packages/SublimeREPL directory, try erasing/backing it up, and running the following in the Packages directory:
git clone git://github.com/wuub/SublimeREPL.git
to get the absolute latest version. Assuming you have IPython set up properly on your system, you should be able to choose Tools -> SublimeREPL -> Python -> Python - IPython and have it run fine. Make sure you have the latest build of Sublime Text 2. I have it set up at work on WinXP with ST2 Build 2220, IPython 0.13.2, and the latest versions of NumPy and matplotlib/pylab, and it works like a charm.
If this still doesn't work, let me know and I'll try and walk you through it...
When I did a search, the first Google result took me to the Sublime Forums, where this thread says "IPython is working on Windows for some time now".
So, It seems like you just need a newer version of Sublime Text and/or SublimeREPL.
Alternatively, as the SublimeREPL FAQ says:
Is this a terminal emulator?
No. Shell (cmd.exe/bash) REPL can be used for simple tasks (file creation, git init etc.) but anything terminal like (mc, ipython, vim) will not work! SublimeREPL has a sister project: SublimePTY that aims to bring real terminal emulator to SublimeText2.
That seems a little out of date, but you can try SublimePTY anyway.
Finally, it looks like the author of SublimeREPL follows the Sublime Forum pretty closely, and in fact a large chunk of the forum seems to be devoted to plugins. So, you will probably do better asking there, rather than here.

IPython IDE for Windows

I recently installed IPython after hearing about it on this forum. I am looking for an environment that is similar to what might come with MATLAB or RStudio for R.
I was under the impression that IPython would give me that but the version I downloaded for Windows looks very bare. In fact I do not really see a difference between IDLE and IPython except tab completion and history (which I have been wanting) but this is about as much as the interpreter that comes with R which I used to think was hard to work with.
Have I misunderstood the point of IPython? Or is it possible that I have not installed correctly?
I have also downloaded the 'Console' and while I am not convinced that it is working properly, it looks very bare as well.
Komodo looks good but is somewhat costly. Netbeans and Eclipse also look good, but do not seem to be straightforward to install, at least for somebody with my level of knowledge, so it would be good if somebody could verify their compatibility with Python, features, and ease of use for a non-expert user.
I suggest you try Spyder
You can find it here : https://www.spyder-ide.org/
It is perfect for you : it is a lightweight Scientific IDE with the explicit purpose of being similar in feel to matlab.
It has an editor, a console and lots of neat features and plug-ins.
It can use IPython as its console.
IPython is "just" an enhanced python console with pure awesomeness built-in. (actually it's much more : it's a client-server architecture with multiple interfaces to pure magic, in console mode, Qt, and even inside a browser with the Notebook)
Definitely check it out later on when you've used the basic console for a while.
For the context, i've been using Eclipse, pycharm, got tired of those, and i started to ask around what people use, and the one i've heard the most about is sublime text.
You should take a look, maybe it's what you are looking for!
I just saw it's not open source though!
What i'm using now is Ninja-IDE, which is written in python and is open source and seems pretty good! It has plenty of plugins, which includes an IPython plugin
Have you tried the qtconsole backend? It was released after you asked your question.
This is a very lightweight widget that largely feels like a terminal,
but provides a number of enhancements only possible in a GUI, such as
inline figures, proper multiline editing with syntax highlighting,
graphical calltips, and much more.
From the Windows command prompt, enter:
ipython qtconsole

What is an excellent instant-run Python debugger/shell? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
So I am really annoyed by using IDLE. I need an IDE or simply a shell that can take a .py file and run it immediately, showing me the results.
I've configured Notepad++ to run python console, and I have to add "raw_input()" at the end of every file so it doesn't disappear. Problem is, if there is a syntax error, it won't show me the error, it won't go to raw_input. So I am forced to use IDLE.
I tried running DreamPie shell with notepad++ but it doesn't work that way. Neither does the IDLE shell.
How can I write Python code and then instantly see the results without using IDLE's editor?
EDIT: I found a plugin called PyNPP it allows you to run the 'interactive shell' for Python immediately, using a shortcut like F6 in Notepad++. This seems to work great! Sublime 2 seems like a nice editor too, but I couldn't get it to run shell.
I would recommend pydev for eclipse. You can download it from the pydev website
What kinds of scripts are you running? If you are doing just pure text output scripts without needing a GUI event loop, check out Sublime. It's a gorgeous editor, and extensible in python if you want to make addins for it. iPython is a great shell which has autocomplete (sort of).
http://www.sublimetext.com/
Komodo Edit is pretty good, has decent autocomplete and its free, it also doesn't suffer from the GUI event loop limitation that Sublime has (though it is also a larger application, and not nearly as pretty).
http://www.activestate.com/komodo-edit
Eclipse, as mentioned earlier, is a great IDE though it is huge - I personally prefer sublime as my goto editor.
I would recommend Emacs with python-mode.el.
This will be harder to get into initially, since Emacs has a bit of a learning curve. However, once you have it down, it has all the advantages of an interactive shell and an IDE. When you're working normally, it's like any other text editor/IDE, where you have syntax highlighting, code completion, and other nice features. When you want to be in a shell, control-c ! will pop one open, and you can paste code in, or highlight your code and send it to the shell.
That being said, Emacs isn't for everyone. Still, a lot of people like it once they learn it. Definitely worth giving a try.
IPython is a souped up version of the standard python shell. It does auto completion and syntax highlighting along with automatically providing help docs for various functions.
I tried several Sublimetext3, Vim etc. but there was always one or more issues.
Then I came across Zeus
http://www.zeusedit.com/index.html
Briljant simple and running straight out of the box if you set the link to the compiler. I am now on the 45 days trial period but I am going to buy it.

Python Code Completion

After using C# for long time I finally decided to switch to Python.
The question I am facing for the moment has to do about auto-complete.
I guess I am spoiled by C# and especially from resharper and I was expecting something similar to exist for Python.
My editor of choice is emacs and after doing some research I found autocomplete.pl, yasnippet and rope although it is not clear to me if and how they can be installed in a cygwin based system which is what I use since all the related documentation appears to be linux specific...
The version of emacs I currently use is 23.2.1 which bundles the python mode that although useful is far behind from whatever research has to offer.
My question to python users has to do about how common is autocomplete vs manual typing (using M-/ where possible) ?
I am thinking about just memorizing python build-in functions like len, append, extend etc. and revert close to a pre-autocomplete editing mode. How different such an approach is from what other pythonistas are doing?
I found this post
My Emacs Python environment
to be the most useful and comprehensive list of instructions and references on how to setup a decent Python development environment in Emacs regardless of OS platform. It is still a bit of work to setup but at least it covers the popular packages and components generally recommended for Python in Emacs that provide auto-completion functionality.
I loosely used this post as a guide to do the setup on my Windows machine with Emacs 23.2.1 and Python 2.6.5. Although, I also have Cygwin installed in some cases instead of running the *nix shell commands mentioned in the post, I just download the packages via a web browser, unzip them with 7zip, and copy them to my Emacs' plugin directory.
Also, to install Pymacs, Rope, and Ropemacs, I used Python's EasyInstall package manager. To use it, I downloaded and installed the setuptools package using the Windows install version. Once installed, at the command line, cd to their respective download locations and run the command
easy_install .
instead of the shell commands shown in the post.
Generally, I saved any *.el files in my ~\.emacs.d\plugins (e.g. in %USERPROFILE%\Application Data\.emacs.d\) and then updated my .emacs file to reference them as documented in the post.
Despite all this, on occasion, I've used DreamPie since it does have overall better auto-completion out of the box than my Emacs setup.
I'm spoiled by Intellisense too. The PyDev extensions for Eclipse offer a pretty good auto-complete substitute.
I find that PyDev + Eclipse can meet most of my needs. There is also PyCharm from the Intellij team. PyCharm has the added advantage of smooth integration with git.
I've been using PyScripter, an IDE for Windows, for a while now, and have found it very good. It has autocompletion among many other features. It's written in Delphi -- not that there's anything wrong with that -- it just bothers me a bit, though...
Take a look at Spyderlib, support most of the features including code completion
IMO, by far the easiest way to take advantage of the python tools available for emacs is to take advantage of the defaults that are all set up at:
https://github.com/gabrielelanaro/emacs-for-python
I actually took the time to get pymacs and ropemacs and python-mode all working independently before finding that little gem, and now I rely on it entirely for all my python based customizations. If you are new, I would definitely start there.

Categories

Resources