Skip to main content

CHAKRAPANI GAUTAM

About Me

Showing posts with the label Linux

Install Python3 on CentOS/RHEL and Fedora

Comments


Working with Python on Linux isn't as spooky as you think. It's just the same as any other programming language that it supports and it's actually fun. You might be wondering how come we work on Linux with that big black screen in front of us. Well, in that case, you would love to check this post out.

Linux distributions are known for having an enormous collection of software packages, and Python is one of them. A simple application on Linux, say a Calculator, requires the support of multiple programming technologies. And to prepare the system to run those applications flawlessly, most of the distributions are prepackaged with different programming environments; like C, C++, Java, PHP, Python etc. So no typical installation is required.


"Then what the heck is this post all about?"

Well, this post is for those who want to play with the latest version of Python without damaging the previous one. It is usually Python 2.7.x on most of the systems to provide backward compatibilities to the applications because they were written way before Python3 was released. But if you're OKAY with your default Python installation, you can skip this post and start with your first Python script.

Now those of you who are still with me, I would like to mention that these steps for installation are typically for RedHat distributions like Fedora, CentOS etc. But you can try them on others as well. All you need to do is to change the default package manager to yours. Like if you're using Ubuntu, you need to change dnf to apt-get in all your commands. And that's it!

So here we go.

Step 1: Install required packages

Use the following command to install the prerequisites for Python.
$ sudo dnf install gcc
This command will install a package called "gcc" which is acronym GNU C Compiler. Why? Well, I would recommend having a quick tour of various Python implementations.

Step 2: Download Python 3.6

Download the package from the official website for the latest version of Python, or type in the following commands.

$ cd /usr/src
$ wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz

Now extract the downloaded package.

$ tar xzf Python-3.4.8.tgz

Step 3: Compile the Python source

It is the most crucial part of the installation. Execute these commands to compile the source and install it on your system.

$ cd Python-3.6.5
$ ./configure --enable-optimizations
$ make altinstall

make altinstall is used to prevent replacing the default python binary file in /usr/bin/python

Now after installation, remove the source archive from your system.

$ rm Python-3.6.5.tgz

Step 4: Confirm the installation

And finally, you can check whether the installation was successful or not.

$ python3 --version
Python 3.6.5

Mission accomplished!


I hope you would've found this post interesting and worth reading. If you've any queries or suggestions for this post, please mention them in comments below.

Happy Programming!

6 Reasons to Switch from Windows 10 to Linux

Comments


For many PC users, the idea of switching away from Windows and onto Linux can be a nerve-wracking one. After all, Linux holds only a minority share of the desktop market, and not all of us know people who are already using it. The idea of making the switch can often feel like taking a blind leap into the unknown. But in recent years, Linux has caught up with Windows for most purposes; in many areas, it has actually overtaken it. And therefore, whether you're completely new to Linux or have dabbled with it once or twice already, I want you to consider running it on your next laptop or desktop—or alongside your existing operating system. Here are some of the reasons for why you should switch from Windows to Linux.

It's free and open

Unlike Microsoft which demands you to upgrade to its latest versions of OS for hundreds of bucks, Linux distributions are completely free to use, tweak and even upgrade! It's also open source which allows you to build a custom-made OS and share with your family and friends. Ain't it cool enough?

Superior security

Windows is notorious for viruses and other malware it tends to pick up. And therefore you have to invest in keeping your system clean and out of infections by means of some premium anti-viruses. Linux, on the other hand, is renowned for its superior security—so much so that security experts recommend it for sensitive applications like online banking, for instance. The reason for being extra-secure lies on the fact that it is an open source entity, which is under the continuous care of engineers, amateurs and computer enthusiasts. Because it's open-source, it's really hard for anyone to target all Linux PCs at once. Unlike Windows, every Linux flavour has a different set of configurations. Most of the users usually compile and make binaries from the source which can be modified in almost indefinite ways. On the other hand, Windows hasn't brought any noticeable change in its core technology, thus making it prone to malware and viruses.

Modest requirements

Windows is often known for the way it forces users to keep upgrading their hardware so as to keep up with the software requirements. Running Windows on minimal configuration will sure be a painful experience as it becomes extremely slow and almost unusable. Whereas Linux is quite the opposite. In fact, it's long been embraced for its ability to run flawlessly even on older or low resource computers. A typical Linux distribution memory requirements may vary from 32MB to 1GB, which is hell lot lesser than that of the Windows 10! Wouldn't it be nice to keep your existing hardware a little longer and put that money towards something else instead?

Flavours for every taste

When it comes to looks, Linux distros rule over Windows. Be it Unity, Cinnamon, Gnome 3, KDE or even low-end desktop environment like Xfce or Lxde, they are much more good looking than Windows desktop. And not only that you're free to choose the Linux flavour, but also the desktop environment. You can experience both Gnome 3 and KDE on the same distribution and customize them to even more astonishing looks as per your requirements.

Community support

Probably the best thing about Linux is its community. You'll never feel alone in the Linux World. Apart from thousands of Linux how-to-do blogs, just drop by any kind of problem you're facing with your system, someone will always try to help out. This is one of the most iconic features of Linux which beats other OS platforms including Windows.

Perfect choice for Developers and Programmers

Last but not the least, Linux distributions are known for providing a perfect development and programming environment for the user. Need to write programs in C, C++, CSS, Java, JavaScript, HTML, PHP, Perl, Python, Ruby, or Vala? Linux supports all of them, and the list goes on. You don't even have to install them on your machine. They're shipped prepackaged with your distribution.

Most of the applications/libraries are designed natively for Linux because of its vast variety of flavours. Just open GitHub, and every other project is supported by Linux distros. All you need is just clone the git package, compile it on your system, and there you go! And when it comes to development, there's something about Linux which is really hard to put in words. The day you get used to Linux, you'll find out that switching to it was one of the best decisions of your life. It's just amazing!



I hope you would've found this article useful and worth reading. If you're new to Linux world, please let me know when you're switching to Linux. Believe me or not, you won't regret it, ever! If you use Linux for programming, what are some other reasons why people should consider it? What’s your favourite programming feature or tool on Linux? Let me know them in the comments.

Happy Programming!