Python Forum

Full Version: Python and PIP on a windows nano server
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

I've been trying to create a docker container of a windows nano server to run a django application.

I'm having trouble with the build and I'm looking for some advice.

Everything appears to install fine from the build file (Below)

# Indicates that the nanoserver image will be used as the base image
FROM microsoft/nanoserver

# Copies the python 37 files to the server
COPY ./Python c:/Python

# Uses PowerShell to set the env path and install get-pip.py
RUN powershell.exe -Command \
  $Env:Path += “;C:\python;C:\python\Python37;C:\python\Python37\Scripts;C:\python\Scripts” ; \
  SETX PATH $Env:Path /M ; \
  python C:\python\Scripts\get-pip.py
but then when I try to use pip I get the this error

nanoerror



Does anyone have any idea why or if it's possible to run on nano server?
https://devblogs.microsoft.com/python/py...no-server/
That article seems to indicate that pip can work fine on a nano server.

Your error is interesting, because the various python files in the traceback are on different drives (C and D).

Does python work on it's own? What happens if you run python -V? What about python -m "ensurepip"?