From: T J <jt...@ou...> - 2017-09-15 08:48:23
|
Hi Abraham, Unfortunately fontforge and system Python won't work, because official releases of Python are compiled with Visual Studio (MSVC), while FontForge is compiled with GCC (okay, there might be a way, but I need to look into this more). So at the moment, if the packages you're after require compilation, then you will need GCC to compile them (and perhaps some patching as well to get it to recognise GCC). FontForge is built using msys2, and in fact takes its Python distribution more or less from that provided from msys2. As I understand it, they do provide a few precompiled python packages, such as numpy, so what you could do is install msys2 and then install mingw-w64-i686-python2, as well as any other packages you want. For anything not precompiled, then you might also need to install gcc (done through msys2's pacman) and run setup.py/pip. Once you're done, copy /mingw32/lib/python2.7 into your FontForge folder (replacing the one under lib/, although you need to also keep fontforge.pyd/psMat.pyd under site-packages), and it should work (touch wood). Thanks, Jeremy ________________________________ From: Abraham Lee <tis...@gm...> Sent: Friday, 15 September 2017 5:50 AM To: Discussion forum for fontforge users Subject: Re: [fontforge-users] Python in FF No problem at all! I completely understand how busy any particular day can be. Here's some other things I've been able to learn in my digging: When you run fontforge_console.bat, that sets up the environment so ffpython should be able to add packages to its own library of files (at least that's what the printed instructions say should be possible). This sounds great, except that when you try to install anything with any method I'm aware of (e.g., via pip, a package's setup.py, etc.) I run into this error: distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module. The source of the error is that distutils/msvc9compiler.py (which is called in the stack during installation of the any package) looks for the string "MSC v." in sys.version. In my normal python installation, sys.version is 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] which contains the desired string. What distutils is really looking for is the number after "v." which is 1500 in this case. This number is larger than 6, so installation proceeds. However, in ffpython, sys.version is 2.7.13 (default, Jan 17 2017, 14:07:43) [GCC 6.3.0 32 bit] So, even though this version of python is newer, "MSC v." isn't found at all, so distutils assumes the version is too old and throws the error. In other words, GCC isn't a recognized compiler by distutils. I can't seem to install anything because of this. That's about the end of the rope I was able to follow. Maybe it sheds some additional light on the situation, though. Any thoughts? Or maybe Jeremy has an idea of what's really going on or can be done. I think if I could get past this, I'd be good to go for the most part. Ultimately, being able to call fontforge.pyd and psMat.pyd from the system's installation of python would be ideal, but I'll take whatever I can get. Thanks again. - Abraham On Thu, Sep 14, 2017 at 11:41 AM, Frank Trampe <fra...@gm...<mailto:fra...@gm...>> wrote: Sorry about that. My day ended up being busier than expected. You've already done the digging I was going to do, so I've asked Jeremy, who is responsible for the Windows build, for help. On Thu, Sep 14, 2017 at 10:55 AM, Abraham Lee <tis...@gm...<mailto:tis...@gm...>> wrote: Hi, Frank! Any luck on getting this to work on Windows? I did some deeper digging to see what's required, but I'm just puzzled. I even tried copying every DLL in the "bin" folder to the "DLLs" folder on my machine and then copying "fontforge.pyd" and "psMat.pyd" into the "Lib/site-packages" folder, but when I tried either "import fontforge" or "import psMat" it crashed python. I think I'm close, but something is still eluding me. Thanks, again, Abraham |