use python3.9 Written Linux Scripts used on , Operating systems are basically centos7, Inside python The environment is python2.7, You need to manually install one on each machine where you want to use scripts python3.9, And manually install the relevant libraries , Is there any way I can put python3.9 The environment and the application library are put together , copy to Linux You can use it directly . Just beginning to learn python Scripts handle server problems , Please give me some advice , Thank you very much .
Take the answer :
try pyinstaller pack
pyinstaller General description of the packaging process (linux)_bingfeiqiji The blog of -CSDN Blog _pyinstaller pack linux One 、 Configured in the file .spec,build.sh , start.sh, stop.sh After the document , The later packaging process is very simple ,(1) among .spec File is a packaging process , And pyinstaller of ( Need further study ), It can define the modules to be extracted , Packed file name and other related information .(2)build.sh It is you who execute the packaging command , Include pyinstaller ***.spec Or if not .spec When you file , Use pyinstaller -F ***.py command , Can be defined in build.sh In the folder , It also includes the execution of
https://blog.csdn.net/bingfeiqiji/article/details/108405220