locked
[Python] [Cloud Service] Python Worker Role and Virtual Env RRS feed

  • Question

  • Whilst trying to debug why my worker role doesn't work, I've logged in to the Machine via RDP to try and exercise the venv manually:

    >cd E:\approot\env\Scripts

    >python

    which leads to the dreaded "The program can't start because python27.dll is missing...."

    I've installed virtaualenv and the windows wrapper manually, and python works fine under "env2".

    the primary Python install under the D drive works fine.

    So the issue must be the way the powershell creates the virtual env in the first place?

    thanks

    (BTW: this is Python 2)

    Edit2:

    After re-reading PipInstaller.ps

    when running a Worker Role, the "base" c:\Python27\ is used as opposed to a virtual env. I guess because a virtual env is pointless in PaaS system? The virtual env directory etc is deployed/moved from Visual Studio to Azure as the directory happens to be there.




    • Edited by geeday Thursday, January 19, 2017 10:46 PM
    • Edited by Gary Liu - MSFT Friday, January 20, 2017 1:34 AM edit title
    Thursday, January 19, 2017 4:59 PM

Answers

  • thanks for the reply.

    the issue was/is my lack of understanding, which i now think I have sorted.

    Part confusion is that it seems Visual Studio is copying the virtual env from my dev machine to the worker role VM, and the Python versions are not compatible. Although i do not configure the worker role to use a VENV anyway.

    My next question would be how to extract params from the *.cscfg and cscfg files within the Python code itself, do  ihave to parse the XML manually or is it part of the Azure Python libraries. I've spent hours looking and have yet to find the correct method. possibly this should be in a new thread?

    • Marked as answer by geeday Wednesday, January 25, 2017 2:49 PM
    Monday, January 23, 2017 9:02 AM

All replies

  • Hi,

    Just to confirm is this issue happening for the first time or experienced before as well? Are you still facing the issue? I would suggest you to check Enabling Azure Diagnostics in Azure Cloud Services to get the more information about the issue.

    Also, please refer the blog post How to debug Python Azure Worker Roles and Debugging cloud services incase if you haven’t checked earlier.

    Regards,
    Ashok

    Friday, January 20, 2017 4:08 PM
  • thanks for the reply.

    the issue was/is my lack of understanding, which i now think I have sorted.

    Part confusion is that it seems Visual Studio is copying the virtual env from my dev machine to the worker role VM, and the Python versions are not compatible. Although i do not configure the worker role to use a VENV anyway.

    My next question would be how to extract params from the *.cscfg and cscfg files within the Python code itself, do  ihave to parse the XML manually or is it part of the Azure Python libraries. I've spent hours looking and have yet to find the correct method. possibly this should be in a new thread?

    • Marked as answer by geeday Wednesday, January 25, 2017 2:49 PM
    Monday, January 23, 2017 9:02 AM
  • Hi,

    Glad to hear that you have sorted out the issue.

    Yes, please create a new thread for the other query for better assistance.

    Regards,
    Ashok

    Tuesday, January 24, 2017 8:03 PM