andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 39 forks source link

exe build failed because of regex #363

Closed andreikop closed 8 years ago

andreikop commented 8 years ago

Hi, Bryan!

Maybe you could check how to make regex work with PyInstaller. I tried to build a binary and got the traces below. Release v15.11 is ready. If you managed to build it - attach a binary here

Traceback (most recent call last):
  File "c:\github\enki\enki\plugins\preview\__init__.py", line 427, in _onDocumentChanged
    self._createDock()
  File "c:\github\enki\enki\plugins\preview\__init__.py", line 455, in _createDock
    from enki.plugins.preview.preview import PreviewDock
  File "c:\python27\lib\site-packages\PyInstaller-3.1.dev0+f927686-py2.7.egg\PyInstaller\loader\pyimod03_importers.py", line 364, in load_module
    exec(bytecode, module.__dict__)
  File "c:\github\enki\enki\plugins\preview\preview.py", line 34, in <module>
    from .preview_sync import PreviewSync
  File "c:\python27\lib\site-packages\PyInstaller-3.1.dev0+f927686-py2.7.egg\PyInstaller\loader\pyimod03_importers.py", line 364, in load_module
    exec(bytecode, module.__dict__)
  File "c:\github\enki\enki\plugins\preview\preview_sync.py", line 36, in <module>
    from approx_match import findApproxTextInTarget
  File "c:\python27\lib\site-packages\PyInstaller-3.1.dev0+f927686-py2.7.egg\PyInstaller\loader\pyimod03_importers.py", line 364, in load_module
    exec(bytecode, module.__dict__)
  File "c:\github\enki\enki\plugins\preview\approx_match.py", line 33, in <module>
    regexVersion = pkg_resources.get_distribution('regex').parsed_version
  File "c:\Python27\lib\site-packages\pkg_resources\__init__.py", line 545, in get_distribution
    dist = get_provider(dist)
  File "c:\Python27\lib\site-packages\pkg_resources\__init__.py", line 425, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "c:\Python27\lib\site-packages\pkg_resources\__init__.py", line 946, in require
    needed = self.resolve(parse_requirements(requirements))
  File "c:\Python27\lib\site-packages\pkg_resources\__init__.py", line 833, in resolve
    raise DistributionNotFound(req, requirers)
DistributionNotFound: The 'regex' distribution was not found and is required by the application
bjones1 commented 8 years ago

I manually coped site-packages/regex-2015.11.09.dist-info to dist/enki and that worked. I'll add a hook to automate this in the future.

andreikop commented 8 years ago

Thanks!

bjones1 commented 8 years ago

My pleasure. I'm currently working on integrating some of the fixes into PyInstaller, and some into Enki. I'll close the issue when this is complete.

bjones1 commented 8 years ago

Fixed by 7168acd2daa10f3dd5a37e8bc585ae213105b9de.