Port Python virtualenv to another system

前端 未结 2 753
情歌与酒
情歌与酒 2021-01-01 02:46

I am using many python packages like numpy, bottleneck, h5py, ... for my daily work on my computer. Since I am root on this machine it is no problem to install these package

2条回答
  •  迷失自我
    2021-01-01 02:59

    You shouldn't move your virtualenv since it is essentially linked to your system python and the binary won't work on other machines.

    However... you can export a list of installed packages and install them in another virtualenv through a requirements.txt file.

    Basically, what I usually do with most of my projects:

    # Generate a requirements file:
    pip freeze > requirements.txt
    

    On the new machine:

    # This uses virtualenvwrapper, but you can do it without as well
    mkproject my_project_name
    git clone git://..../ .
    pip install -r requirements.txt
    

提交回复
热议问题