Port Python virtualenv to another system

前端 未结 2 771
情歌与酒
情歌与酒 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:50

    Having manually compiled VTK and PySide2 for Python36, I have also found myself bending the virtualenv rules.

    Just today, I transferred my virtualenv to another system, and to make things easier, I gave it the exact same path that it had on the previous system. However, I did not have the same path for Python on my new system. Fortunately I was able to change the location that the virtualenv was looking for by altering a 'orig-prefix.txt' file located in [VIRTUALENV]/Lib.

    The base Python path a virtualenv requires is stored in: [VIRTUALENV]/Lib/orig-prefix.txt

    If I recall correctly, the path of the virtualenv itself is embedded in multiple files. Thus, in a case where I needed to relocate the virtualenv to a different path, I just recreated it and copied over everything except for the [VIRTUALENV]/Scripts directory.

    This is probably not the way virtualenv is meant to be used, but it does provide a work-around. Also, note that I am doing this in a Windows environment.

提交回复
热议问题