开发者

Any productive way to install a bunch of packages

开发者 https://www.devze.com 2023-01-05 01:00 出处:网络
I had one machine with my commonly used python package installed. and i would like to install the same package on another machine or same machine with different python version. I would like to know wh

I had one machine with my commonly used python package installed. and i would like to install the same package on another machine or same machine with different python version. I would like to know whether pip or easy-ins开发者_如何学编程tall or some other method can let me install those packages in a batch. When i use perl, it has something like a bundle package, how to do that in python?


Pip has some great features for this. It lets you save all requirements from an environment in a file using pip freeze > reqs.txt

You can then later do : pip install -r reqs.txt and you'll get the same exact environnement.

You can also bundle several libraries into a .pybundle file with the command pip bundle MyApp.pybundle -r reqs.txt, and later install it with pip install MyApp.pybundle.

I guess that's what you're looking for :)


I keep a requirements.txt file in one of my repositories that has all my basic python requirements and use PIP to install them on any new machine.

Each of my projects also has it's own requirements.txt file that contains all of it's dependencies for use w/virtualenv.

0

精彩评论

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