omxhealth / drugbank-sample-apps

Sample apps for the DrugBank API
The Unlicense
5 stars 1 forks source link

python venv clarification #10

Closed agentdave closed 4 years ago

agentdave commented 4 years ago

People using python all the time may not need this (and probably have their own methods anyway for dealing with other environments), but for the ones that don't, it might be helpful to actually show the creation of an environment here:

https://github.com/omxhealth/drugbank-sample-apps#setting-up-the-virtual-environment

And then use that, instead of env as the placeholder in subsequent commands.

petreman commented 4 years ago

Hmm ok, so explain a bit more why the virtual environment is needed and how it's created, and maybe add how to run the app without it?

agentdave commented 4 years ago

It's not really needed, but it looks like we're starting to set up a virtual env here (which I think is great, in case they have other work they're doing in python):

Screen Shot 2020-08-14 at 2 47 30 PM

I think the commands someone would have to run would be more like:

python -m venv drugbank-sample
source drugbank-sample/bin/activate

The documentation is not wrong on this front. It implies that you have to create the environment and then activate it, but if someone's new to Python, they might not catch that the env portion of source env/bin/activate is the placeholder, and going the extra step of just providing a suggested environment name would let them copy/paste. Make sense?

petreman commented 4 years ago

Yeah I just realized how much I messed up this part, oops. Thanks for bringing it to my attention, it should be better now.