2017-05-20 11 views
1

Pyinstaller로 .exe을 만들려고합니다. hook-mpl_toolkits.basemap이라는 후크를 포함해야합니다. 나는 다음과 같은 .spec 파일에 후크를 추가 :훅 디렉토리가 없습니다.

# -*- mode: python -*- 

block_cipher = None 

a = Analysis(['xxx.py'], 
      pathex=['C:\\...\\...\\xxx'], 
      binaries=[], 
      datas=[], 
      hiddenimports=[], 
      hookspath=['C:\\...\\...\\hooks\\hook-mpl_toolkits.basemap.py'], 
      runtime_hooks=[], 
      excludes=[], 
      win_no_prefer_redirects=False, 
      win_private_assemblies=False, 
      cipher=block_cipher) 
pyz = PYZ(a.pure, a.zipped_data, 
      cipher=block_cipher) 
exe = EXE(pyz, 
      a.scripts, 
      exclude_binaries=True, 
      name='map', 
      debug=False, 
      strip=False, 
      upx=True, 
      console=True) 
coll = COLLECT(exe, 
       a.binaries, 
       a.zipfiles, 
       a.datas, 
       strip=False, 
       upx=True, 
       name='map') 

을하지만 "Pyinstaller xxx.spec"실행할 때, 나는 오류가 나타납니다

Hook directory not found

앤 제안을?

답변

1

hookspath은 경로가 아니라 파일입니다. 그것은해야합니다 자체가 파이썬 모듈의 이름과 일치하도록 선택된다

hookspath=['C:\\...\\...\\hooks'], 

후크,이 경우 :

mpl_toolkits.basemap