python部署_python项目部署

20200220215036858046.jpg

https://xiulian.blog.csdn.net/article/details/88080765

https://cloud.tencent.com/developer/news/397399

https://www.cnblogs.com/shiyongge/p/10582552.html

https://blog.csdn.net/u012874140/article/details/101595503

pip失效

https://blog.csdn.net/xxzhangx/article/details/53558654

https://blog.csdn.net/weixin_39416561/article/details/83375409

pyinstaller XXX.spec成功日志:

D:\pythonTest\FaceRecognition\FaceCode>pyinstaller flask_run.spec

152 INFO: PyInstaller: 4.0.dev0+a1f92c6a08

152 INFO: Python: 3.7.0 (conda)

153 INFO: Platform: Windows-10-10.0.18362-SP0

162 INFO: UPX is not available.

167 INFO: Extending PYTHONPATH with paths

[‘D:\\pythonTest\\FaceRecognition\\FaceCode‘,

‘D:\\pythonTest\\FaceRecognition\\FaceCode‘,

‘D:\\pythonTest\\FaceRecognition\\FaceCode‘,

‘D:\\pythonTest\\FaceRecognition\\FaceCode‘,

‘D:\\pythonTest\\FaceRecognition\\FaceCode‘,

‘D:\\pythonTest\\FaceRecognition\\FaceCode‘,

‘D:\\pythonTest\\FaceRecognition\\FaceCode‘,

‘D:\\pythonTest\\FaceRecognition\\FaceCode‘,

‘D:\\pythonTest\\FaceRecognition\\FaceCode‘,

‘D:\\pythonTest\\FaceRecognition\\FaceCode‘,

‘D:\\pythonTest\\FaceRecognition\\FaceCode‘]

167 INFO: checking Analysis

167 INFO: Building Analysis because Analysis-00.toc is non existent

167 INFO: Initializing module dependency graph...

174 INFO: Caching module graph hooks...

179 INFO: Analyzing base_library.zip ...

4268 INFO: Caching module dependency graph...

4372 INFO: running Analysis Analysis-00.toc

4389 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable

required by C:\Users\lihong\AppData\Local\Continuum\anaconda3\python.exe

4732 INFO: Analyzing flask_run.py

5689 INFO: Processing pre-find module path hook distutils

5691 INFO: distutils: retargeting to non-venv dir ‘C:\\Users\\lihong\\AppData\\Local\\Continuum\\anaconda3\\lib‘

11425 INFO: Processing pre-safe import module hook six.moves

15154 INFO: Processing pre-safe import module hook setuptools.extern.six.moves

16247 INFO: Processing pre-find module path hook site

16249 INFO: site: retargeting to fake-dir ‘C:\\Users\\lihong\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\pyinstaller-4.0.dev0+a1f92c6a08-py3.7.egg\\PyInstaller\\fake-modules‘

26736 INFO: Analyzing D:\pythonTest\FaceRecognition\FaceCode\face_capture\base_face_capture.py

26739 INFO: Analyzing D:\pythonTest\FaceRecognition\FaceCode\face_capture\picture_face_capture.py

26741 INFO: Analyzing D:\pythonTest\FaceRecognition\FaceCode\face_capture\video_face_capture.py

26742 INFO: Analyzing D:\pythonTest\FaceRecognition\FaceCode\face_cartoon\convert_face_image.py

26742 INFO: Analyzing D:\pythonTest\FaceRecognition\FaceCode\face_recognize\base_face_recognize.py

26744 INFO: Analyzing D:\pythonTest\FaceRecognition\FaceCode\face_recognize\picture_face_recognize.py

26746 INFO: Analyzing D:\pythonTest\FaceRecognition\FaceCode\face_recognize\video_face_recognize.py

26747 INFO: Analyzing D:\pythonTest\FaceRecognition\FaceCode\utility\general_utility.py

26749 INFO: Analyzing D:\pythonTest\FaceRecognition\FaceCode\utility\json_helper.py

26750 INFO: Processing module hooks...

26750 INFO: Loading module hook "hook-cryptography.py"...

27262 INFO: Loading module hook "hook-cv2.py"...

27263 INFO: Loading module hook "hook-distutils.py"...

27264 INFO: Loading module hook "hook-encodings.py"...

27373 INFO: Loading module hook "hook-jinja2.py"...

27386 INFO: Loading module hook "hook-lib2to3.py"...

27391 INFO: Loading module hook "hook-numpy.core.py"...

27506 INFO: MKL libraries found when importing numpy. Adding MKL to binaries

27515 INFO: Loading module hook "hook-numpy.py"...

27517 INFO: Loading module hook "hook-PIL.Image.py"...

28233 INFO: Loading module hook "hook-PIL.py"...

28235 INFO: Excluding import ‘PyQt5‘

28236 INFO: Removing import of PyQt5.QtGui from module PIL.ImageQt

28237 INFO: Removing import of PyQt5.QtCore from module PIL.ImageQt

28237 INFO: Import to be excluded not found: ‘FixTk‘

28237 INFO: Excluding import ‘PyQt4‘

28239 INFO: Removing import of PyQt4 from module PIL.ImageQt

28239 INFO: Excluding import ‘tkinter‘

28241 INFO: Removing import of tkinter from module PIL.ImageTk

28241 INFO: Excluding import ‘PySide‘

28244 INFO: Removing import of PySide from module PIL.ImageQt

28244 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...

28246 INFO: Excluding import ‘tkinter‘

28248 INFO: Import to be excluded not found: ‘FixTk‘

28248 INFO: Loading module hook "hook-pkg_resources.py"...

29452 INFO: Processing pre-safe import module hook win32com

29803 WARNING: Hidden import "pkg_resources.py2_warn" not found!

29804 INFO: Excluding import ‘__main__‘

29806 INFO: Removing import of __main__ from module pkg_resources

29809 INFO: Loading module hook "hook-pycparser.py"...

29993 INFO: Loading module hook "hook-PyQt5.py"...

30537 WARNING: Hidden import "PyQt5.sip" not found!

30537 INFO: Loading module hook "hook-PyQt5.QtCore.py"...

30659 INFO: Loading module hook "hook-PyQt5.QtGui.py"...

30872 INFO: Loading module hook "hook-pytest.py"...

32244 INFO: Loading module hook "hook-pythoncom.py"...

33081 INFO: Loading module hook "hook-pywintypes.py"...

33941 INFO: Loading module hook "hook-scipy.py"...

33945 INFO: Loading module hook "hook-setuptools.py"...

35121 INFO: Loading module hook "hook-sysconfig.py"...

35123 INFO: Loading module hook "hook-win32com.py"...

36081 INFO: Loading module hook "hook-xml.dom.domreg.py"...

36082 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...

36083 INFO: Loading module hook "hook-xml.py"...

36083 INFO: Loading module hook "hook-_tkinter.py"...

36365 INFO: checking Tree

36365 INFO: Building Tree because Tree-00.toc is non existent

36365 INFO: Building Tree Tree-00.toc

36493 INFO: checking Tree

36493 INFO: Building Tree because Tree-01.toc is non existent

36494 INFO: Building Tree Tree-01.toc

36562 INFO: checking Tree

36562 INFO: Building Tree because Tree-02.toc is non existent

36562 INFO: Building Tree Tree-02.toc

36581 INFO: checking Tree

36582 INFO: Building Tree because Tree-03.toc is non existent

36583 INFO: Building Tree Tree-03.toc

36589 INFO: checking Tree

36589 INFO: Building Tree because Tree-04.toc is non existent

36589 INFO: Building Tree Tree-04.toc

36592 INFO: checking Tree

36593 INFO: Building Tree because Tree-05.toc is non existent

36594 INFO: Building Tree Tree-05.toc

36598 INFO: Looking for ctypes DLLs

36666 INFO: Analyzing run-time hooks ...

36674 INFO: Including run-time hook ‘pyi_rth_pkgres.py‘

36680 INFO: Including run-time hook ‘pyi_rth_win32comgenpy.py‘

36683 INFO: Including run-time hook ‘pyi_rth_multiprocessing.py‘

36710 INFO: Looking for dynamic libraries

36833 WARNING: lib not found: mpich2mpi.dll dependency of C:\Users\lihong\AppData\Local\Continuum\anaconda3\Library\bin\mkl_blacs_mpich2_lp64.dll

36846 WARNING: lib not found: mpich2mpi.dll dependency of C:\Users\lihong\AppData\Local\Continuum\anaconda3\Library\bin\mkl_blacs_mpich2_ilp64.dll

36860 WARNING: lib not found: impi.dll dependency of C:\Users\lihong\AppData\Local\Continuum\anaconda3\Library\bin\mkl_blacs_intelmpi_lp64.dll

37623 WARNING: lib not found: msmpi.dll dependency of C:\Users\lihong\AppData\Local\Continuum\anaconda3\Library\bin\mkl_blacs_msmpi_ilp64.dll

37737 WARNING: lib not found: impi.dll dependency of C:\Users\lihong\AppData\Local\Continuum\anaconda3\Library\bin\mkl_blacs_intelmpi_ilp64.dll

37834 WARNING: lib not found: tbb.dll dependency of C:\Users\lihong\AppData\Local\Continuum\anaconda3\Library\bin\mkl_tbb_thread.dll

37868 WARNING: lib not found: msmpi.dll dependency of C:\Users\lihong\AppData\Local\Continuum\anaconda3\Library\bin\mkl_blacs_msmpi_lp64.dll

37909 WARNING: lib not found: pgf90.dll dependency of C:\Users\lihong\AppData\Local\Continuum\anaconda3\Library\bin\mkl_pgi_thread.dll

37915 WARNING: lib not found: pgc14.dll dependency of C:\Users\lihong\AppData\Local\Continuum\anaconda3\Library\bin\mkl_pgi_thread.dll

37921 WARNING: lib not found: pgf90rtl.dll dependency of C:\Users\lihong\AppData\Local\Continuum\anaconda3\Library\bin\mkl_pgi_thread.dll

38952 INFO: Looking for eggs

38952 INFO: Using Python library C:\Users\lihong\AppData\Local\Continuum\anaconda3\python37.dll

38953 INFO: Found binding redirects:

[]

38960 INFO: Warnings written to D:\pythonTest\FaceRecognition\FaceCode\build\flask_run\warn-flask_run.txt

39081 INFO: Graph cross-reference written to D:\pythonTest\FaceRecognition\FaceCode\build\flask_run\xref-flask_run.html

39110 INFO: Appending ‘datas‘ from .spec

39119 INFO: checking PYZ

39120 INFO: Building PYZ because PYZ-00.toc is non existent

39120 INFO: Building PYZ (ZlibArchive) D:\pythonTest\FaceRecognition\FaceCode\build\flask_run\PYZ-00.pyz

42108 INFO: Building PYZ (ZlibArchive) D:\pythonTest\FaceRecognition\FaceCode\build\flask_run\PYZ-00.pyz completed successfully.

42135 INFO: checking PKG

42135 INFO: Building PKG because PKG-00.toc is non existent

42135 INFO: Building PKG (CArchive) PKG-00.pkg

42171 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.

42173 INFO: Bootloader C:\Users\lihong\AppData\Local\Continuum\anaconda3\lib\site-packages\pyinstaller-4.0.dev0+a1f92c6a08-py3.7.egg\PyInstaller\bootloader\Windows-64bit\run.exe

42173 INFO: checking EXE

42173 INFO: Building EXE because EXE-00.toc is non existent

42174 INFO: Building EXE from EXE-00.toc

42175 INFO: Appending archive to EXE D:\pythonTest\FaceRecognition\FaceCode\build\flask_run\flask_run.exe

42182 INFO: Building EXE from EXE-00.toc completed successfully.

42185 INFO: checking COLLECT

42186 INFO: Building COLLECT because COLLECT-00.toc is non existent

42188 INFO: Building COLLECT COLLECT-00.toc

46227 INFO: Building COLLECT COLLECT-00.toc completed successfully.

原文地址:https://www.cnblogs.com/zwh1993/p/12337584.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Python项目部署是将开发好的Python应用程序发布到服务器上,以便在生产环境中运行。下面是部署Python项目的一般步骤: 1. 配置服务器环境:在部署Python项目之前,需要先配置服务器环境。这包括安装操作系统、搭建Web服务器(如Nginx)以及安装Python和相关的依赖库。 2. 设置虚拟环境:为了隔离不同项目的依赖关系,建议在部署Python项目时创建一个独立的虚拟环境。虚拟环境可以使用工具如virtualenv或者conda创建。 3. 安装项目依赖:在虚拟环境中,使用pip命令安装项目所需的依赖库,可以通过requirements.txt文件来管理依赖。 4. 配置uWSGI:uWSGI是一款用于运行Python Web应用程序的服务器软件。在部署Python项目时,需要配置uWSGI的相关参数,如chdir(项目目录)、module(WSGI模块)、home(Python执行环境)等。这些配置可在uWSGI的配置文件中进行设置。 5. 配置Nginx:Nginx是一款高性能的Web服务器,用于处理HTTP请求和反向代理。在部署Python项目时,需要配置Nginx,将HTTP请求转发给uWSGI服务器。配置中需要指定uWSGI的监听地址和端口,并指定静态文件的映射。 6. 启动服务:完成配置后,可以启动Nginx和uWSGI服务。可以使用启动命令来启动uWSGI,并使用系统服务管理工具(如systemd)来管理Nginx。 总结起来,Python项目部署的主要步骤包括配置服务器环境、设置虚拟环境、安装项目依赖、配置uWSGI和Nginx、以及启动服务。这样,您的Python项目就可以在服务器上正常运行了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值