0

I made a website using mezzanine-Django , and used conda env to contain it (I should have used virtual env). but the fabric file is tuned to only deploy virtual envs. What should I do to get my conda env up in the VPS , is there an easy way or should I be installing every packages inside manually?

1 Answers1

0

I would assume you have already created the virtual environment, then what you have to do is:

Put all python packages you want to install for your project inside requirements.txt

from fabric import task

    @task(hosts=["servername"])
    def do_things(c):
        with c.cd('your_dir'):
            # assuming you already added myenv to your path 
            with c.prefix('source activate myenv'): 
                c.run('pip3.6 install -r requirements.txt') #for example if you have pip3.6

You have to use with c.prefix() to enable using that environment! And remember you have to run everything within the scope of with c.prefix('source activate myenv'): if you want to use the virtual environment.

Peshmerge
  • 1,024
  • 1
  • 14
  • 27