- Configuring Ubuntu for Python Development¶
- Vim¶
- GASP¶
- Getting GASP from Launchpad¶
- $HOME environment¶
- Making a python script executable and runnable from anywhere¶
- 11 Best Python IDEs for Ubuntu in 2022
- 1. Vim
- 2. PyCharm
- 3. Eric
- 4. Pyzo
- 5. Spyder
- 6. GNU Emacs
- 7. Atom
- 8. PyDev (Eclipse)
- 9. Wing
- 10. Thonny
- 11. IDLE
- Conclusion
- About the author
- Swapnil Tirthakar
Configuring Ubuntu for Python Development¶
Note: the following instructions assume that you are connected to the Internet and that you have both the main and universe package repositories enabled. All unix shell commands are assumed to be running from your home directory ($HOME). Finally, any command that begins with sudo assums that you have administrative rights on your machine. If you do not — please ask your system administrator about installing the software you need.
What follows are instructions for setting up an Ubuntu 9.10 (Karmic) home environment for use with this book. I use Ubuntu GNU/Linux for both development and testing of the book, so it is the only system about which I can personally answer setup and configuration questions.
In the spirit of software freedom and open collaboration, please contact me if you would like to maintain a similar appendix for your own favorite system. I’d be more than happy to link to it or put it on the Open Book Project site, provided you agree to answer user feedback concerning it.
Vim¶
Vim can be used very effectively for Python development, but Ubuntu only comes with the vim-tiny package installed by default, so it doesn’t support color syntax highlighting or auto-indenting.
To use Vim, do the following:
- From the unix command prompt, run:
$ sudo apt-get install vim-gnome
syntax enable filetype indent on set et set sw=4 set smarttab map :w\|!python %
When you edit a file with a .py extension, you should now have color systax highlighting and auto indenting. Pressing the key should run your program, and bring you back to the editor when the program completes.
To learn to use vim, run the following command at a unix command prompt:
GASP¶
Several of the case studies use GASP (Graphics API for Students for Python), which is the only additional library needed to use this book.
To install GASP on Ubuntu 9.04 (Jaunty) or later, run the following command at a unix command prompt:
$ sudo apt-get install python-gasp
or use the synaptic package manager.
Getting GASP from Launchpad¶
To install the latest version of GASP into your home directory, run the following commands at a unix command prompt:
$ sudo apt-get install bzr $ bzr branch lp:gasp-code
$HOME environment¶
The following creates a useful environment in your home directory for adding your own Python libraries and executable scripts:
- From the command prompt in your home directory, create bin and lib/python subdirectories by running the following commands:
$ mkdir bin lib $ mkdir lib/python
PYTHONPATH=$HOME/lib/python EDITOR=vim export PYTHONPATH EDITOR
Making a python script executable and runnable from anywhere¶
On unix systems, Python scripts can be made executable using the following process:
- Add this line as the first line in the script:
11 Best Python IDEs for Ubuntu in 2022
Python is one of the most widely used general purpose programming language. Most of the popular websites or application software that you use every day are powered by Python.
The reason behind the popularity of this programming language is its simple and easy to understand nature. Data Science and Data Analytics are applications of the Python programming. These fields are responsible for creating many jobs across the world.
There are many Integrated Development Environments (IDEs) available for editing and programming in Python. Personally, I prefer Vim in Ubuntu terminal but there many IDEs like PyCharm, GNU Emacs and Pyzo that are available for Ubuntu. So, today we are going to discuss these IDEs one-by-one.
1. Vim
- Syntax highlighting
- Support for other programming languages apart from Python
- Great community support
Vim is my #1 preferred IDE right from the college projects and even today because it makes the tedious task like programming very easy and enjoyable. Vim is also used by many developers and Linux users because it is very fast and is a highly customizable IDE. More importantly, Vim makes the debugging task easier and it has a support for many tools and plug-ins.
Vim can be used as both standalone application as well as command line interface. Many new users might find it difficult to use initially, but once you get used to it, you will love programming on Vim.
2. PyCharm
PyCharm is very popular cross-platform Python IDE which comes in two editions, namely community and professional edition. Community edition is free and open-source while the pro edition is paid. It is highly customizable and features rich IDE with features like Integrated Unit Testing and Python Debugger, error highlighting, code analysis, and many more which you can expect in IDE.
Pycharm has one of the best GUI as compared to the other Python IDEs and could be good choice for professional developers. It is available for the latest releases of Ubuntu under Snap package and can be downloaded directly from Ubuntu Software Centre.
3. Eric
Eric is an open-source integrated development environment written and developed in Python. It is a cross-platform IDE with support for many programming languages including Python. Eric IDE is bundled with so many features which includes code auto-completion, error highlighting, integrated Python debugger, advance search, syntax highlighting, etc.
Eric has simple but highly customizable GUI with support for plug-ins and extensions. It also sports integrated class browser which you will not find in any IDEs.
4. Pyzo
- Interactive user interface
- No need of Python interpreter
Pyzo is an open-source programming environment based on Python. It is uses conda to manage the Python packages. It is a simple and interactive IDE but there is no compromise with its features. Some of the features include syntax highlighting, indentation guide, Matlab like UI, drag and drop files and directories, etc.
Pyzo also features interactive help, file browser, and has support for all the major programming languages. Pyzo can be downloaded and installed from the Software Centre or terminal command.
$ sudo apt-get install python3-pip python3-pyqt4
$ sudo python –m pip install pyzo –upgrade
Once the installation is complete, run the following command to start the Pyzo IDE.
5. Spyder
Spyder is a cross-platform integrated development environment that is especially designed for scientific programing in Python. It is a multi-language IDE with features like code auto-completion, syntax highlighting, code analysis, horizontal and vertical splitting.
Spyder has layout-based UI which makes it easily navigated and easy to use for new users as well.
6. GNU Emacs
GNU Emacs is an integrated development environment developed under the GNU project. It is a cross-platform code editor. It is a customizable code editor with support for Python programming language out of the box. It is one of the most powerful IDEs available for programming in Python.
GNU Emacs has simple user interface which offers excellent end user experience. Emacs is not only limited to programming as you can use it for web browsing, email, etc.
$ sudo add-apt-repository ppa:kelleyk/emacs
$ sudo apt-get install emacs
7. Atom
Atom is a free and open-source text editor with features like any integrated development environments. It is developed by GitHub and supports almost all the major programming languages including Python. By installing some extensions and plug-ins, you can bring the IDE-like functionality to Atom.
Atom has slick user interface and offers features like auto-completion, syntax highlighting, diagnostics, and many more.
$ sudo add-apt-repository ppa:webupd8team/atom
8. PyDev (Eclipse)
PyDev is a third-party plug-in for Eclipse which is an integrated development environment developed for scientific programing in Python. It offers features such as code analysis, graphical debugging, code refactoring, etc.
As PyDev is integrated in Eclipse, it has a very good user interface. It also has integration with PyLint. To use the PyDev, you just need to install the Eclipse from the Ubuntu Software Center and add the PyDev plug-in to it.
9. Wing
Wing is an IDE developed by Wingware. It is especially designed for Python programming language. Wing offers many features such as auto-completion, auto-editing, source browser, code navigation, and both local and remote debugging.
Wing has flexible user interface with everything placed perfectly so that you can easily find whatever you want.
Download Wing package from here:
10. Thonny
Thonny is a simple IDE especially designed for beginners. It has simple and easy use user interface with some basic features like debugger, code completion, etc. Thonny comes loaded with Python 3.6 built out of the box which requires simple installer to get started with Python programming.
The best thing about Thonny is that it has a beginner-friendly system shell. You can open the system shell from the Tools many to install the extra packages or to learn the Python handling on the command line. You can download and install Thonny from Ubuntu Software Centre.
11. IDLE
IDLE is an integrated development environment for Python programming language. It is written in Python programming language and Tkinter GUI toolkit. It is a cross-platform IDE which also works effortlessly on Windows and macOS apart from Linux and its distributions.
Talking about the features it offers, the multiple windows, auto completion, colorizing of code input are one of the many noteworthy features. Apart from that, it is also a highly configurable Python IDE.
$ sudo apt-get install idle3
Conclusion
To conclude, selecting the best IDE always depends on the programmer’s preferences and needs. The IDEs listed here are the best in terms of code editing, debugging, and overall user experience.
About the author
Swapnil Tirthakar
A Software Engineer who loves football and passionate about traveling. I often spend my free time playing with gadgets and exploring new possibilities in tech world. I am Linux enthusiast and have about 6 years of experience in web development. I have good command on Python, Java, SQL and system security.