using pip to install

Sue Folkerts 16 Reputation points
2021-03-28T21:14:22.56+00:00

how do I use pip to install on Azure. I have an AppService. I am running a python web app. I need to install win32printing. I don't know how to get to the place where I can run pip.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,933 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Grmacjon-MSFT 19,151 Reputation points Moderator
    2021-03-29T00:42:09.867+00:00

    Hi @Sue Folkerts ,

    Currently, Python is supported on Azure App Service for Linux, and you can publish apps using Git deploy and containers.
    Please see this tutorial: Configure a Linux Python app for Azure App Service for how to run pip in app service. This article describes how Azure App Service runs Python apps, how you can migrate existing apps to Azure, and how you can customize the behavior of App Service when needed. Python apps must be deployed with all the required pip modules.

    The App Service deployment engine automatically activates a virtual environment and runs pip install -r requirements.txt for you when you deploy a Git repository, or a zip package.

    Hope that helps. Please let us know if you have further questions.

    -Grace

    0 comments No comments

  2. Folkerts, Sue 1 Reputation point
    2021-03-30T21:17:15.257+00:00

    I did get to install it using Windows Terminal. Here is the log from deployment:
    sue@Azure:~$ pip install --no-dependencies win32printing
    Defaulting to user installation because normal site-packages is not writeable
    Collecting win32printing
    Using cached win32printing-0.1.3.tar.gz (4.9 kB)
    Building wheels for collected packages: win32printing
    Building wheel for win32printing (setup.py) ... done
    Created wheel for win32printing: filename=win32printing-0.1.3-py3-none-any.whl size=4847 sha256=656d0306dc8aab1b03ecf937dcdb1447fc77439d4bb31a05af623e0b6b71201a
    Stored in directory: /home/sue/.cache/pip/wheels/5a/03/08/c15778a0f56291506c7652b31dc34fb544d4ac9e36d60f918e
    Successfully built win32printing
    Installing collected packages: win32printing
    Successfully installed win32printing-0.1.3
    WARNING: You are using pip version 20.2.4; however, version 21.0.1 is available.
    You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.

    Unfortunately, I am still getting the same error. I have a feeling I did not install it at the right place. Now I need to figure out how to get to the right place to install it.


  3. Folkerts, Sue 1 Reputation point
    2021-03-30T22:39:26.247+00:00

    I ran this command:
    export PYTHONPATH="${PYTHONPATH}:/my/other/path"

    0 comments No comments

  4. Folkerts, Sue 1 Reputation point
    2021-03-30T22:44:46.207+00:00

    Here is the install command now:
    pip install --no-dependencies win32printing
    Defaulting to user installation because normal site-packages is not writeable
    Requirement already satisfied: win32printing in ./.local/lib/python3.7/site-packages (0.1.3)

    Still getting the same error "No module names 'win32printing'"


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.