Python 技术篇-将项目打包成whl文件,whl包的制作方法

通过pip help wheel查看wheel的命令发现:

  -w, --wheel-dir <dir>       Build wheels into <dir>, where the default is
                              the current working directory.

这就是whl的打包命令,我下了一个PyHook3的源码来进行试验,就是.tar.gz结尾的文件解压后就能看到项目源码。

C:\Users\Administrator>pip wheel -w, -wheel-dir C:\Users\Administrator\Desktop\P
yHook3-1.6.1
Processing c:\users\administrator\desktop\pyhook3-1.6.1
Building wheels for collected packages: PyHook3
  Building wheel for PyHook3 (setup.py) ... done
  Stored in directory: c:\users\administrator\heel-dir
Successfully built PyHook3

什么版本的python就会生成对应版本的whl文件。

whl文件保存位置:
c:\users\administrator\heel-dir
上面指明了。

想用whl打包功能,可能需要vc++运行库,如果遇到
Microsoft Visual C++ 14.0 is required 报错,

请看我的这篇文章:
vc++运行库安装

运行成功图示:
在这里插入图片描述PyHook3项目源码:
在这里插入图片描述
喜欢的点个赞❤吧!

posted on 2019-03-06 15:39  小蓝枣  阅读(331)  评论(0)    收藏  举报