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:
- Generate a list of third party python libs current installed
- 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.
精彩评论