Export and import import and export Python-- configuration environment configuration of python environment

Export and import Python-- configuration environment

 
Export Python environment installed package
[root @ bogon ~] # pip freeze> packages.txt
This will create a packages.txt file, which contains all the current environment package and a simple list of each version (ie listed pip list the package list)
mounted introduced Python environment package
[root @ bogon ~] # pip install -r packages.txt
 
Copy the code
Tips: 
    When using the Python easy_install or pip install third-party libraries, the default source address is: https: //pypi.python.org/simple/ 
this is the source of a few problems: 
    1. foreign site access speed is slower. 
    2. use the source follows the http protocol, if not installed openssl ssl configuration or not the machine, cause easy_install or pip access to the source             
    fail, if you want to solve these two problems, 
     you can use the domestic PyPI mirror source (regularly put foreign software copied to this library). 
    Some pipy mirror source of the country: 
        1. Qinghua Source: https://pypi.tuna.tsinghua.edu.cn/simple 
        2. watercress Source: https://pypi.douban.com/simple 
        3.pypi.hustunique. com 
 
 
to access domestic sources of pipy installation command: 
      PIP install the library name == 1.11.11 -i https://pypi.tuna.tsinghua.edu.cn/simple
Copy the code

 

Export Python environment installed package
[root @ bogon ~] # pip freeze> packages.txt
This will create a packages.txt file, which contains all the current environment package and a simple list of each version (ie listed pip list the package list)
mounted introduced Python environment package
[root @ bogon ~] # pip install -r packages.txt
 
Copy the code
Tips: 
    When using the Python easy_install or pip install third-party libraries, the default source address is: https: //pypi.python.org/simple/ 
this is the source of a few problems: 
    1. foreign site access speed is slower. 
    2. use the source follows the http protocol, if not installed openssl ssl configuration or not the machine, cause easy_install or pip access to the source             
    fail, if you want to solve these two problems, 
     you can use the domestic PyPI mirror source (regularly put foreign software copied to this library). 
    Some pipy mirror source of the country: 
        1. Qinghua Source: https://pypi.tuna.tsinghua.edu.cn/simple 
        2. watercress Source: https://pypi.douban.com/simple 
        3.pypi.hustunique. com 
 
 
to access domestic sources of pipy installation command: 
      PIP install the library name == 1.11.11 -i https://pypi.tuna.tsinghua.edu.cn/simple
Copy the code

 

Guess you like

Origin www.cnblogs.com/love2000/p/11639572.html