Python dependencies overall migration method

1. Create a new site-packages directory, go to the next site-packages directory;

2. pip freeze performed at site-packages directory> requirements.txt;

3. Check requirements.txt, you can see the current machine dependencies python has generated a list of all

4. In the current directory execute pip download -rrequirements.txt, you can see the pip start downloading dependencies list of all dependencies

 

5. Wait for the download is complete, you can see already dependent package files in the current directory

 

6. The site-packages folder package, we need to move the machine dependencies of these;

7. performed at a current site-packages directory machine: pip install --no-index --find-links = / xxx / xxx / site-packages -r /xxx/xxx/site-packages/requirements.txt

(Where: / xxx / xxx / site-packages dependencies specified path, / xxx / xxx / site-packages / requirements.txt dependencies specified path list);

8. Do pip list, see all the current pip python dependencies installed, you can see we migrated library has been installed successfully

 

Guess you like

Origin www.cnblogs.com/flowertester/p/11355484.html