From: Jeff M. <jef...@za...> - 2021-03-01 23:34:35
|
fwiw, with xlsxwriter, I just imported that and good to go. https://xlsxwriter.readthedocs.io/ I don't even bother with pip in this one project, I have a 'contrib' directory that I drop in various libs. (Connectivity to internet is unavailable on this target server, and working on cached egg files or whatever seemed like work.) So in this case, I clone the repo to a dir in contrib, use sys.path.append ( contrib-dir-path ), and then import xlsxwriter On Mon, Mar 1, 2021 at 5:33 PM Régis Ramillien <reg...@gm...> wrote: > Dear jython users, > > I'm new to python, and I would like to call a python script from java. > After a little bit of research, I decided to use jython. > > I want the java program to let an admin generate custom excel files using > python. > > That's why I need to install openpyxl, multiprocessing and finally pillow > to load images into the xlsx. > > But installing pillow gives me some troubles. > First, I got a "java heap space" exception. So I tried installing it using > this command: > > ---------------------------------------------------------------------------------------------- > jython -J-Xmx1g -m pip install pillow. > > ---------------------------------------------------------------------------------------------- > I know, you're right, 1g seems enormous ! But I still get java heap space > with 512mb... > > And with 1g of memory, I receive this stack: > > ---------------------------------------------------------------------------------------------- > c:\Tools\jython2.7.2\bin>jython -J-Xmx1g -m pip install pillow > [33mDEPRECATION: A future version of pip will drop support for Python 2.7. > [0m > Collecting pillow > Using cached > https://files.pythonhosted.org/packages/b3/d0/a20d8440b71adfbf133452d4f6e0fe80de2df7c2578c9b498fb812083383/Pillow-6.2.2.tar.gz > [31m ERROR: Complete output from command python setup.py egg_info: [0m > [31m ERROR: Traceback (most recent call last): > File "<string>", line 1, in <module> > File > "C:\Users\RGISRA~1\AppData\Local\Temp\pip-install-ctmgop\pillow\setup.py", > line 25, in <module> > import mp_compile > File "mp_compile.py", line 11, in <module> > from multiprocessing import Pool, cpu_count > File > "C:\Tools\jython2.7.2\Lib\site-packages\multiprocessing\__init__.py", line > 64, in <module> > import multiprocessing.patch > File > "C:\Tools\jython2.7.2\Lib\site-packages\multiprocessing\patch.py", line 58, > in <module> > class ConditionPatch(object): > File > "C:\Tools\jython2.7.2\Lib\site-packages\multiprocessing\patch.py", line 61, > in ConditionPatch > notify_all = threading._Condition.notifyAll.im_func > AttributeError: 'module' object has no attribute '_Condition' > ---------------------------------------- [0m > [31mERROR: Command "python setup.py egg_info" failed with error code 1 in > C:\Users\RGISRA~1\AppData\Local\Temp\pip-install-ctmgop\pillow\ [0m > [33mWARNING: You are using pip version 19.1, however version 20.3.4 is > available. > You should consider upgrading via the 'pip install --upgrade pip' command. > [0m > > ---------------------------------------------------------------------------------------------- > > Does any one able to install pillow on jython ? Or is it a pillow issue ? > Or my fault ? > > Thank you all for your kind help ! > > Best regards, > > Régis Ramillien > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > -- Jeff Mitchell Sr Application Architect Zayo | Our Fiber Fuels Global Innovation 1821 30th Street | Unit A | Boulder, CO 80301 Desk: 999.999.9999 | Cell: 999.999.9999 jef...@za... Purpose <http://zayo.is/signature-purpose> | Network Map <http://zayo.is/signature-network> | LinkedIn <http://zayo.is/signature-linkedin> | Twitter <http://zayo.is/signature-twitter> This communication is the property of Zayo and may contain confidential or privileged information. If you have received this communication in error, please promptly notify the sender by reply e-mail and destroy all copies of the communication and any attachments. He who dies with the best barbecue sauce, wins. |