Install the latest Python and pip on Windows.
table of contents
Hello everyone. This is Saito from the infrastructure team.
This time, I will introduce how to install version 3.5 of the programming language Python.
Python is often used on servers, but
the versions of Python that are pre-installed on servers are often outdated.
So let's go ahead and install Python, which has the latest features.
Installation instructions
On Windows, installation is performed using an installer, but
there are some points that get stuck when using the installed command.
The purpose of this article is to create an environment where you can run python commands and pip commands on the command prompt.
I will focus on the following points.
1. Install Python
You can use python by downloading the installer from the URL below and following the instructions.
https://www.python.org/downloads/
2. Decide where to install
This time, I installed
Python35 under C:Usersbeyond Set the installation directory to a location that does not require administrator privileges.
" C:Program Files ", you may not be able to use the command due to permissions.
3. Setting the path
Let's set the Path to the directory created by the installer.
C:UsersbeyondPython35 C:UsersbeyondPython35Scripts
It is best to set the Path using the Control Panel or
the Rapid Environment Editor
4. install pip
Download the python file below.
https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
run the downloaded file ( ez_setup.py
> chdir C:UsersbeyondDownloads > ls ez_setup.py > python ez_setup.py
After running the downloaded file, it's time to prepare pip.
> easy_install.exe pip
This completes the environment construction.
To check the version, use the options below.
> python -V > pip -V
Install packages with pip
If there are any modules you need, use pip to install the packages.
Use the pip command as follows.
> pip install --upgrade pip > pip install<package>
Let's try installing the following packages using pip.
> pip install virtualenv > pip install pip-tools > pip install ipython > pip install wheel
Use the following command to see the list of installed packages.
> pip freeze
Precautions when installing
If a C/C++ compiler is not installed on Windows,
problems may occur such as pip not working properly depending on the package.
In that case, you will receive an error requesting you to install Visual C++.
For python 2.7, this plugin can solve the problem.
If you want to install without installing the compiler,
compiled ( .whl ) file is distributed.
the wheel mentioned earlier is installed.
> pip install wheel
Finally, let's install using wheel.
For example, suppose you want to install the following packages:
https://pypi.python.org/pypi/ScalaFunctional/0.5.0
From here, first install the
ScalaFunctional-0.5.0-py2.py3-none-any.whl go to the download location and run pip.
> chdir C:UsersbeyondDownloads > ls ez_setup.py ScalaFunctional-0.5.0-py2.py3-none-any.whl > pip install ScalaFunctional-0.5.0-py2.py3-none-any.whl
The installation is now complete. thank you for your hard work.
Now, just type python on the command prompt and python will start.
the installed package by typing import
> python Python 3.5.0a3 (v3.5.0a3:82656e28b5e5, Mar 30 2015, 00:12:00) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import this
Please try installing Python & pip using the method I introduced. Have a good import life!
2020/03/09 P.S.
This article was featured on courseduck.com
We have a lot of content where you can learn Python for free, so please take a look.
The Best Courses to Learn Python in 2020
https://www.courseduck.com/programming/python/