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项目源码:

喜欢的点个赞❤吧!
各位好,我是csdn的小蓝枣,现在我的博客已经同步到博客园啦,欢迎大家关注哈!也欢迎大家关注我的公众号Py_JSQY!每天会更新有趣的科技文!哈哈!
浙公网安备 33010602011771号