zooba / vsts-python-tasks

Azure Pipelines tasks for Python
https://marketplace.visualstudio.com/items?itemName=stevedower.python
MIT License
8 stars 5 forks source link

How to run an installed package? #24

Open Sl1ckR1ck opened 4 years ago

Sl1ckR1ck commented 4 years ago

Hi, this is probably a noob question but i cant seem to figure it out, sorry about that...

So i have a Run Python command where i would like to run a given package which i have previously install.

The package is located under the installed python (Installed with the Install Python on Window task).

However i am not sure how i can run it without explicitly give it a path to the actual script like i am doing below: image

How can i do this without hardcoding the path? Currently i need to change it everytime a new version is installed.

Thanks!

Sl1ckR1ck commented 4 years ago

Actually let me correct a bit my question.

I actually need to run a script file deployed with the package. Running it using the -m option doesn't work. I was not the developer of this script and it fails when trying to run as a module.

Therefore i need to find a way to get the path to the site-package folder. Its there any variable defined by anychange that point to it or to the python .exe folder?