Re: How to install pillow
Jeff Mitchell <[email protected]> Mon, 1 Mar 2021 18:01:57 -0500
| Newsgroups | gmane.comp.lang.jython.user |
|---|---|
| Message-ID | <CAAdVdyhbwNTTrww80zdBR6xWgp7baBamOxm34qdJBH06m13gVQ@mail.gmail.com> |
--===============3300305580459098430== Content-Type: multipart/alternative; boundary="0000000000007a677d05bc819bf8" --0000000000007a677d05bc819bf8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=C3=A9gis Ramillien <regis.ramillien@gmail.= com> 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 usin= g > 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/a20d8440b71adfbf133452d4f6e= 0fe80de2df7c2578c9b498fb812083383/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", lin= e > 64, in <module> > import multiprocessing.patch > File > "C:\Tools\jython2.7.2\Lib\site-packages\multiprocessing\patch.py", line 5= 8, > in <module> > class ConditionPatch(object): > File > "C:\Tools\jython2.7.2\Lib\site-packages\multiprocessing\patch.py", line 6= 1, > in ConditionPatch > notify_all =3D 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=C3=A9gis Ramillien > _______________________________________________ > Jython-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jython-users > --=20 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 [email protected] 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. --0000000000007a677d05bc819bf8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">fwiw, with xlsxwriter, I just imported that and good to go= .<div><br></div><div><a href=3D"https://xlsxwriter.readthedocs.io/">https:/= /xlsxwriter.readthedocs.io/</a><br></div><div><br></div><div>I don't ev= en bother with pip in this one project, I have a 'contrib' director= y 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</div><div><br></di= v></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr= ">On Mon, Mar 1, 2021 at 5:33 PM R=C3=A9gis Ramillien <<a href=3D"mailto= :[email protected]">[email protected]</a>> wrote:<br></d= iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord= er-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div = dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"= ltr"><div dir=3D"ltr">Dear jython users,<div><br></div><div>I'm new to = python, and I would like to call a python script from java.</div><div>After= a little bit of research, I decided to use jython.</div><div><br></div><di= v>I want the java program to let an admin generate custom excel files using= python.</div><div><br></div><div>That's why I need to install openpyxl= , multiprocessing and finally=C2=A0pillow to load images into the xlsx.</di= v><div><br></div><div>But installing pillow gives me some troubles.=C2=A0</= div><div>First, I got a "java heap space" exception. So I tried i= nstalling it using this command:</div><div>--------------------------------= --------------------------------------------------------------<br></div><di= v>jython -J-Xmx1g -m pip install pillow.</div><div>------------------------= ----------------------------------------------------------------------<br><= /div><div>I know, you're right, 1g seems enormous ! But I still get jav= a heap space with 512mb...<br></div><div><br></div><div>And with 1g of memo= ry, I receive this stack:</div><div>---------------------------------------= -------------------------------------------------------</div><div><div>c:\T= ools\jython2.7.2\bin>jython -J-Xmx1g -m pip install pillow</div><div> [3= 3mDEPRECATION: A future version of pip will drop support for Python 2.7. [0= m</div><div>Collecting pillow</div><div>=C2=A0 Using cached <a href=3D"http= s://files.pythonhosted.org/packages/b3/d0/a20d8440b71adfbf133452d4f6e0fe80d= e2df7c2578c9b498fb812083383/Pillow-6.2.2.tar.gz" target=3D"_blank">https://= files.pythonhosted.org/packages/b3/d0/a20d8440b71adfbf133452d4f6e0fe80de2df= 7c2578c9b498fb812083383/Pillow-6.2.2.tar.gz</a></div><div> [31m=C2=A0 =C2= =A0 ERROR: Complete output from command python setup.py egg_info: [0m</div>= <div> [31m=C2=A0 =C2=A0 ERROR: Traceback (most recent call last):</div><div= >=C2=A0 =C2=A0 =C2=A0 File "<string>", line 1, in <modul= e></div><div>=C2=A0 =C2=A0 =C2=A0 File "C:\Users\RGISRA~1\AppData\L= ocal\Temp\pip-install-ctmgop\pillow\setup.py", line 25, in <module&= gt;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 import mp_compile</div><div>=C2= =A0 =C2=A0 =C2=A0 File "mp_compile.py", line 11, in <module>= ;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 from multiprocessing import Pool, c= pu_count</div><div>=C2=A0 =C2=A0 =C2=A0 File "C:\Tools\jython2.7.2\Lib= \site-packages\multiprocessing\__init__.py", line 64, in <module>= ;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 import multiprocessing.patch</div><= div>=C2=A0 =C2=A0 =C2=A0 File "C:\Tools\jython2.7.2\Lib\site-packages\= multiprocessing\patch.py", line 58, in <module></div><div>=C2=A0= =C2=A0 =C2=A0 =C2=A0 class ConditionPatch(object):</div><div>=C2=A0 =C2=A0= =C2=A0 File "C:\Tools\jython2.7.2\Lib\site-packages\multiprocessing\p= atch.py", line 61, in ConditionPatch</div><div>=C2=A0 =C2=A0 =C2=A0 = =C2=A0 notify_all =3D threading._Condition.notifyAll.im_func</div><div>=C2= =A0 =C2=A0 AttributeError: 'module' object has no attribute '_C= ondition'</div><div>=C2=A0 =C2=A0 -------------------------------------= --- [0m</div><div> [31mERROR: Command "python setup.py egg_info" = failed with error code 1 in C:\Users\RGISRA~1\AppData\Local\Temp\pip-instal= l-ctmgop\pillow\ [0m</div><div> [33mWARNING: You are using pip version 19.1= , however version 20.3.4 is available.</div><div>You should consider upgrad= ing via the 'pip install --upgrade pip' command. [0m</div></div><di= v>-------------------------------------------------------------------------= ---------------------<br></div><div><br></div><div>Does any one able to ins= tall pillow on jython ? Or is it a pillow issue ? Or my fault ?</div><div><= br></div><div>Thank you all for your kind help !</div><div><br></div><div>B= est regards,</div><div><br></div><div>R=C3=A9gis Ramillien</div></div></div= ></div></div></div></div></div> _______________________________________________<br> Jython-users mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">Jyt= [email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/jython-users" rel= =3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listi= nfo/jython-users</a><br> </blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"= class=3D"gmail_signature"><div dir=3D"ltr"><span><p dir=3D"ltr" style=3D"l= ine-height:1.656;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size= :10pt;font-family:"Trebuchet MS";color:rgb(127,127,127);font-weig= ht:700;vertical-align:baseline;white-space:pre-wrap">Jeff Mitchell</span></= p><p dir=3D"ltr" style=3D"line-height:1.656;margin-top:0pt;margin-bottom:0p= t"><span style=3D"font-size:10pt;font-family:"Trebuchet MS";color= :rgb(127,127,127);font-weight:700;vertical-align:baseline;white-space:pre-w= rap">Sr Application Architect</span></p><p dir=3D"ltr" style=3D"line-height= :1.656;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:12pt;font= -family:"Trebuchet MS";color:rgb(247,150,70);font-weight:700;vert= ical-align:baseline;white-space:pre-wrap">Zayo | Our Fiber Fuels Global Inn= ovation</span></p><p dir=3D"ltr" style=3D"line-height:1.656;margin-top:0pt;= margin-bottom:0pt"><span style=3D"font-size:10pt;font-family:"Trebuche= t MS";color:rgb(127,127,127);font-weight:700;vertical-align:baseline;w= hite-space:pre-wrap">1821 30th Street | Unit A | Boulder, CO=C2=A0 80301</s= pan></p><p dir=3D"ltr" style=3D"line-height:1.656;margin-top:0pt;margin-bot= tom:0pt"><span style=3D"font-size:10pt;font-family:"Trebuchet MS"= ;color:rgb(127,127,127);font-weight:700;vertical-align:baseline;white-space= :pre-wrap">Desk: 999.999.9999 | Cell: 999.999.9999</span></p><p dir=3D"ltr"= style=3D"line-height:1.656;margin-top:0pt;margin-bottom:0pt"><span style= =3D"font-size:10pt;font-family:"Trebuchet MS";color:rgb(17,85,204= );font-weight:700;vertical-align:baseline;white-space:pre-wrap"><a href=3D"= mailto:[email protected]" target=3D"_blank">[email protected]</a>= </span></p><p dir=3D"ltr" style=3D"line-height:1.656;margin-top:0pt;margin-= bottom:0pt"><a href=3D"http://zayo.is/signature-purpose" target=3D"_blank">= <span style=3D"font-size:9.5pt;font-family:"Trebuchet MS";color:r= gb(17,85,204);font-weight:700;vertical-align:baseline;white-space:pre-wrap"= >Purpose</span></a><span style=3D"font-size:9.5pt;font-family:"Trebuch= et MS";font-weight:700;vertical-align:baseline;white-space:pre-wrap"> = |</span><a href=3D"http://zayo.is/signature-network" target=3D"_blank"><spa= n style=3D"font-size:9.5pt;font-family:"Trebuchet MS";color:rgb(3= 4,34,34);font-weight:700;vertical-align:baseline;white-space:pre-wrap"> </s= pan><span style=3D"font-size:9.5pt;font-family:"Trebuchet MS";col= or:rgb(17,85,204);font-weight:700;vertical-align:baseline;white-space:pre-w= rap">Network Map</span></a><span style=3D"font-size:9.5pt;font-family:"= ;Trebuchet MS";font-weight:700;vertical-align:baseline;white-space:pre= -wrap"> |</span><a href=3D"http://zayo.is/signature-linkedin" target=3D"_bl= ank"><span style=3D"font-size:9.5pt;font-family:"Trebuchet MS";co= lor:rgb(34,34,34);font-weight:700;vertical-align:baseline;white-space:pre-w= rap"> </span><span style=3D"font-size:9.5pt;font-family:"Trebuchet MS&= quot;;color:rgb(17,85,204);font-weight:700;vertical-align:baseline;white-sp= ace:pre-wrap">LinkedIn</span></a><span style=3D"font-size:9.5pt;font-family= :"Trebuchet MS";font-weight:700;vertical-align:baseline;white-spa= ce:pre-wrap"> | </span><a href=3D"http://zayo.is/signature-twitter" target= =3D"_blank"><span style=3D"font-size:9.5pt;font-family:"Trebuchet MS&q= uot;;color:rgb(17,85,204);font-weight:700;vertical-align:baseline;white-spa= ce:pre-wrap">Twitter</span></a></p><br><p dir=3D"ltr" style=3D"line-height:= 1.656;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:9pt;font-f= amily:"Trebuchet MS";color:rgb(127,127,127);font-weight:700;font-= style:italic;vertical-align:baseline;white-space:pre-wrap">This communicati= on is the property of Zayo and may contain confidential or privileged infor= mation. If you have received this communication in error, please promptly n= otify the sender by reply e-mail and destroy all copies of the communicatio= n and any attachments.</span></p><p style=3D"line-height:1.656;margin-top:0= pt;margin-bottom:0pt"><span style=3D"font-size:9pt;font-family:"Trebuc= het MS";color:rgb(127,127,127);font-weight:700;font-style:italic;verti= cal-align:baseline;white-space:pre-wrap"><br></span></p><p style=3D"line-he= ight:1.656;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:9pt;f= ont-family:"Trebuchet MS";color:rgb(127,127,127);font-weight:700;= font-style:italic;vertical-align:baseline;white-space:pre-wrap">He who dies= with the best barbecue sauce, wins.</span></p></span></div></div> --0000000000007a677d05bc819bf8-- --===============3300305580459098430== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============3300305580459098430== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Jython-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jython-users --===============3300305580459098430==--