I have been a windows user for a very long time, but quite recently, I decided to switch to Linux. Currently, I am using Ubuntu 16.0.4 LTS, which I still think is a great Debian based Linux Distribution for someone new to Linux. To be honest, the journey as a Linux user has been like a rollercoaster ride, after all, after using completely GUI based operating system like Windows, it may get annoying to use command line/ terminal for installing software.
For me, installing apps using terminal isn't that worst part, in fact sites like askubuntu.com and in most cases even the websites for the required app makes the job easier, the worst part is when "apparently" the installation command looks to be correct, still however, some error pops up in the terminal. Then we try to search the web but get solutions only for windows machine even after exclusively mentioning "Linux" in the search bar. Something similar happened with me while trying to install Django in my Linux machine.
Django is a free and open source python based framework that I have been planning to use in one of my project. As python users may already know, in order to install python packages that are not installed by default, one needs to use "pip". PIP is a package manager for python packages and modules. The "pip" command needs to be used in order to install and python packages and modules. The process is the same for Windows as well.
PIP actually is not installed by default while installing Python, it actually needs to be installed exclusively. I learned this while trying to install Django in my machine as I didn't had it installed back then. "No Problem", I said, "let's search the web and find out how to install pip in linux". I searched and found the below command.
| python get-pip.py |
For those who are about to install Django for Python 3, DO NOT use the above command. In Linux (specifically Ubuntu 16.0.4 LTS), by default, this command is for Python 2 and not Python 3. Instead of the above "python" command, use "python3" command instead. Well, I tried that, but then, I got the below warning.
| WARNING: The scripts pip, pip3 and pip3.5 are installed in '/home/saurabh/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. |
I actually ignored this warning and went ahead with installing Django using the below command.
| pip install --pre django |
I pressed enter to install Django, however, the same warning message popped up again.
I searched the web, and found a stackoverflow link. I checked it and found that it is the solution for Windows and not Linux. Click here to get to that page in case you are a Windows user getting this warning.
Luckily, I found a link to askubuntu.com page that gave me a solution. Apparently, the solution is just to run these commands as super user by using "sudo". At the end, I did that and it really worked. Below are the commands that I used at the end.
| sudo python3 get-pip.py sudo pip install --pre django |
In case you are also getting the same warning as me, then feel free to try the above final commands.
Social Media Links:
LinkedIn
Comments
Post a Comment