Sea*_*ene 6 python sockets windows exe pyinstaller
我在Windows中,使用pyInstaller打包python文件.但是发生了一些错误:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "D:\Useful Apps\pyinstaller-2.0\PyInstaller\loader\iu.py", line 386, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "D:\Useful Apps\pyinstaller-2.0\PyInstaller\loader\iu.py", line 480, in doimport
exec co in mod.__dict__
File "D:\Useful Apps\pyinstaller-2.0\server\build\pyi.win32\server\out00-PYZ.pyz\SocketServer", line 132, in <module>
File "D:\Useful Apps\pyinstaller-2.0\PyInstaller\loader\iu.py", line 386, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "D:\Useful Apps\pyinstaller-2.0\PyInstaller\loader\iu.py", line 480, in doimport
exec co in mod.__dict__
File "D:\Useful Apps\pyinstaller-2.0\server\build\pyi.win32\server\out00-PYZ.pyz\socket", line 47, in <module>
File "D:\Useful Apps\pyinstaller-2.0\PyInstaller\loader\iu.py", line 409, in importHook
raise ImportError("No module named %s" % fqname)
ImportError: No module named _socket
Run Code Online (Sandbox Code Playgroud)
我知道那PyInstaller是在路径中_socket,但怎么能让C:\Python27\libs\_socket.lib那个文件找到?
kar*_*tan 14
如果您使用 virtualenv,则应使用“-p”或“--path='D:...'”选项。像这样:
pyinstaller.exe --onefile --paths=D:\env\Lib\site-packages .\foo.py
Run Code Online (Sandbox Code Playgroud)
这样做是用这个 pathex 路径生成 foo.spec 文件
| 归档时间: |
|
| 查看次数: |
21192 次 |
| 最近记录: |