4

I downloaded some packages in my environment using pip command. And I want to have a copy of them to transfer them to another environment. I know that using:

pip freeze > requirements.txt

will generate requirements into a file, but since my second environment does not have access to internet i can not use:

pip install -r requirements.txt

to install that packages again. Is there any way to copy installed packages? or somehow install packages in a specified directory in my first environment? Thanks

1 Answers1

10

You can use pip download followed by pip install --find-links to achieve what you want.Here is the steps involved

  1. Get the requirements

pip freeze>requirements.txt

  1. Download the packages to a folder
pip download -r requirements.txt -d path_to_the_folder
  1. From the new environment

pip install -r requirements.txt --find-links=path_to_the_folder

Jose Cherian
  • 6,297
  • 3
  • 34
  • 38