0

I am cloning a project's venv directory to my Windows environment. The virtual env was created on a Linux box. As a result, I guess, it doesn't include the Scripts\Activate script. The Scripts\ folder is completely empty.

What do I need to do to Activate the environment (so I can use it in Visual Studio Code)?

Edit: Apparently I got the venv paradigm wrong. You don't share the venv, but only the requirements.txt and allow each dev to create their venv (or not, if they choose). Thanks @bck and @Santiago

Stephan B
  • 58
  • 8
  • Why do you copy venv? – Olvin Roght May 26 '21 at 15:06
  • 1
    Virtual environments should remaking on every device. They're working different on every OS. For solving your problem just remove old environment and remake by documentation. – m3r1v3 May 26 '21 at 15:08
  • 2
    It's not best practices to clone the venv for a project. If it has a requerirements.txt you should be able to create a venv and replicate the environment. On the other side, more info is info about your setup – Santiago P May 26 '21 at 15:09
  • We're experimenting with virtual environments. Isn't the point of having one that you can share the packages with all devs so they don't have to install everything in global? – Stephan B May 26 '21 at 15:10
  • My project code is stored in the venv\myproject directory. Should we not have done that? – Stephan B May 26 '21 at 15:13
  • 2
    No, just every developer should make virtual environment on her PC and install all requirements. – m3r1v3 May 26 '21 at 15:14
  • 1
    @StephanB Indeed you are sharing your `requirements.txt` file with other devs, not the whole environment. Would it be efficient if you shared `node_modules` every time ? [Can I move a virtualenv ?](https://stackoverflow.com/questions/32407365/can-i-move-a-virtualenv) – BcK May 26 '21 at 15:15
  • Our initial idea was that, by synchronizing our venv, our prod environment will automatically get any packages we update in the venv repo because it resyncs every few minutes automatically. Any thoughts on that aspect of it? – Stephan B May 26 '21 at 15:49
  • 1
    @StephanB Update the `requirements.txt`. Thus, when your system detects a change in the file, it should update the virtual environment accordingly. – BcK May 26 '21 at 16:23
  • Does python have any internal tricks to automate that, or do I need to write an external script for that? – Stephan B May 26 '21 at 17:05

1 Answers1

0

Apparently I got the venv paradigm wrong. You don't share the venv, but only the requirements.txt and allow each dev to create their venv (or not, if they choose). Thanks @bck and @Santiago

Stephan B
  • 58
  • 8