How to inject credentials to python virtual env in jenkins?
In order to pass masked credentials to your Jenkins job, do the following:


In Jenkins, install Credentials Binding plugin.
In your Jenkins, go to Credentials and click the global domain.
In the left pane, click "Add credential".
From the "Kind" dropdown, choose "Username with password".
Enter the username and password in the reflective boxes and choose an ID (you will use this ID when you want to access the credentials) and click OK.
Then, in your job, under "Build environment", check "Use secret text(s) or file(s)" and it will add a "Binding" section and an "Add" button, click the "Add" button and "username and password separated", choose a variable name to hold the username and another to hold the password and choose the credentials you created earlier from the credentials dropdown.
Then, in the "Build" section of the job, you can access the credentials using your chosen username and password variables.


I wrote an article about this subject in the past so feel free to check it for more detailed explanation and screen shots.