开发者

What is an efficient way to reinstall all my python libraries after baselining my windows pc?

My windows laptop is being replaced due to some hardware problems. I've spent the last two years installing third party libraries every so often, which I'll need to reinstall on the new machine. I just need to:

  1. Generate a list of third party python libs current installed
  2. Reinstall those on the new machine

My thought right now is to look at c:\python\lib\site-packages and manually write out the list, then try to create a configuration file fo开发者_开发知识库r Setuptools and EasyInstall which I could run as a script of sorts, which would install all these libraries. Is that feasible?


Take a look at pip's freeze command and install from requirements file: http://pip.openplans.org/#freezing-requirements

Warning: pip may not be able to install all your packages in Windows (I think it has some limitations for some packages with native libraries that must be recompiled).


You might want to look into virtualenv. It lets you have a "virtual environment" for Python that would eliminate this need in the future. As for getting the old libs on the new system, you can check the PYTHONPATH environment variable and/or sys.path from the interpreter to see what all paths are searched and you can do some looking around to see what you'd need to install to get back to where you were.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜