Closed bjones1 closed 10 years ago
Hi
This solution requires setuptools. I wouldn't like to have one more dependency unless necessary.
If one wants to execute enki from the sources, he might run python bin/enki
, and if enki is installed to the system - it is installed as a binary.
Is it necessary to fix this problem?
I added enki.py
entry point, which is used on Windows. Is it OK now?
I can understand your reluctance to use setuptools. IMHO, it's a good thing because it creates an executable for Windows, allowing usage like "enki" from the command line rather than "enki.py" from the command line. However, factoring out the original enki script into main.py is a good thing. On Windows, I get one error when running the installed version:
C:\Users\bjones\Documents\enki_all\enki>enki.py
Traceback (most recent call last):
File "C:\Python27\Scripts\enki.py", line 15, in
The enki.py script is being imported, in preference to the enki directory in site-packages. I'm not sure how to fix this search order problem without renaming enki.py to something else. However, using setuptools should fix it, since there will no longer be an enki.py (it will be turned into enki.exe).
Another problem: pyinstaller fails, with a similar error: trying to import enki.main from the enki.py script, rather than the enki module.
Hi
I found a bug in enki.py. Could you please try now?
However, using setuptools should fix it, since there will no longer be an enki.py (it will be turned into enki.exe).
If I understand correctly, setuptools will fix situation, when Enki is installed to the system with ./setup.py install
. But, is it common situation on Windows? I expect that developers will run Enki from the sources, and users will install pyinstaller generated binary
With the fix, I still see the same results:
python bin\enki.py
and my local version of Enki run. I can even cd bin
then python enki.py
and it runs.python setup.py install
, running enki.py
still produces the same error. Honestly, I don't understand why Python is doing this -- something in how it searches paths confuses me.python c:\Python27\Scripts\enki.py
also produces the same error.On my PC, the default Python path is:
['', 'C:\Python27\lib\site-packages\pyinstaller-2.1-py2.7.egg', 'C:\Windows\system32\python27.zip', 'C:\Python27\DLLs', 'C:\Python27\lib', 'C:\Python27\lib\plat-win', 'C:\Python27\lib\lib-tk', 'C:\Python27', 'C:\Python27\lib\site-packages', 'C:\Python27\lib\site-packages\FontTools', 'C:\Python27\lib\site-packages\itk', 'C:\Python27\lib\site-packages\win32', 'C:\Python27\lib\site-packages\win32\lib', 'C:\Python27\lib\site-packages\Pythonwin', 'c:\python27\lib\site-packages', 'C:\Python27\lib\site-packages\wx-2.8-msw-unicode']
I finally figured out how to make this work. I'll submit a pull request.
Rename enki executable or package to avoid conflicts
bin/enki-editor.pyw
Currently, setup.py lists bin/enki as a script, but this doesn't work on Windows. Instead, should use http://pythonhosted.org/setuptools/setuptools.html#automatic-script-creation to create a cross-platform script. I think the extra entry to setup() would be:
and rename bin/enki to bin/enki.py.