[PYTHON] Enable pip installation with Windows Azure website creation (Django project)

Background

PyCon JP 2014 Sprint, which was held on the last day of PyCon JP 2014 held from September 12th to 15th, 2014, was held at [Microsoft Japan Shinagawa Headquarters Seminar Room] ](Http://www.microsoft.com/ja-jp/mscorp/branch/sgt.aspx) rented the venue.

I didn't understand much about Azure, so I gave a tutorial for the PaaS version again. I tried to install an additional module of Python, and pip could not be used.

I wanted to do something about this, so I decided to put in pip and virtualenv, and challenged it.

Working method

Download the latest version of the pip installation file from the following folder. (You can download it on Azure)

https://bootstrap.pypa.io/get-pip.py

Install pip and virtualenv

> python get-pip.py --user
> python -m pip install --user virtualenv

Installed below

C:\DWASFiles\Sites\~1xxxxxxxxxx\AppData\Python

Create a Python environment called myenv in your own folder

python -m virtualenv myenv

From now on, you can install the module using the following pip. I thought, but it doesn't seem to work. Continued investigation required.

> myenv\Scripts\pip.exe

Commentary

If Python is installed in a location that the user cannot write to, a new module cannot be installed in the site-packages folder, resulting in an error.

With the latest pip, you can now use the option --user, install pip in your home directory, and even create a virtualenv.

This allows you to create a Python environment anywhere you like with virtualenv, even if you don't have administrator (root) privileges.

However, in this Azure environment, it was not possible to activate, so it is necessary to call Python etc. with full Path specification every time. (In Windows, it seems that there are conditions such as because environment variables affect globally ??)

Acknowledgments

@Aodag, who is the most detailed in Japan around packaging and seems to be in the top ranks even if you look for it all over the world, helped me.

Recommended Posts

Enable pip installation with Windows Azure website creation (Django project)
Use Python / Django with Windows Azure Cloud Service!
PIL installation with pip
Minimal website environment with django
Django Getting Started: 2_ Project Creation
[Note] Django project creation and terminology
Command installation destination with pip, easy_install
[Python Windows] pip install with Python version
Python installation and package management with pip
Django + Apache with mod_wsgi on Windows Server 2016
Ramen map creation with Scrapy and Django
Let's install box2d-py with Windows 10 environment pip