[Thread Prev][Thread Next][Index]

Re: [ferret_users] MacOS pyferret problem with eps output



Dear Martin,

Very great help! I really appreciate your great effort telling me this. Actually, I tried to modify four files but pyferret gave me error when opening a plot window. I will try your method later and see.

Older version I mean miniconda2. In this env, I can have both pyqt4 and 5, but in Miniconda3 I can only have 5. I installed pyqt4 before pyferret, and when installing pyferret it automatically get pyqt5 as dependency.

Thanks,
Tony

Sent from my iPhone

> On Apr 22, 2019, at 5:38 AM, Martin Schmidt <martin.schmidt@xxxxxxxxxxxxxxxxx> wrote:
> 
> Hi Tony,
> 
> it is easter and spring here. So I enjoyed the free day.
> 
> If you are using latex: latex accepts also png. Not sure, if pdf accepts "landscape", but this is another point ... many papers accept or require tiff. I png is well produced you are at the save side and can produce highly resolving images easiely tranformed into other formats with standard tools.
> 
> pyferret is using python and qt to render images. Implementing eps-output would be a big deal and there must be strong advantages of eps to justify this work. (I am not a ferret developer, hope I am right here.)
> 
> You said, that ferret is "installing" PyQt5. There is an older pyferret in a miniconda, do you mean this? May be it has qt5 as dependency and it is installed when installing pyferret?
> 
> What I am speaking about below, is a system where you install qt4, qt5 and the python interfaces PyQt4 and PyQt5. This should be possible on a Mac without and with a miniconda.
> 
> Miniconda is an installer system, which does not care about installed system components. It installes everythinging in its own "environment". This is easy to use, things within the conda environment are usually consistent. The price is that you fill your harddrive fastly.
> 
> How to proceed with qt? May be you test the usability of PyQt first.
> 
> please check the following:
> 
> Open a terminal  and start that python used with pyferret. You mentioned a miniconda, please use this python. There may be another version in you system. "which python" helps to check, what you are using.
> 
> > python
> 
> Now both should work:
> 
> >>> import PyQt5
> >>> import PyQt4
> 
> This means both versions of qt, qt4 and qt5, are installed and the python interface is usable. Quit python
> >>> quit()
> >
> Next change to your ferret root directory, where you find the subdirectories bin, lib go etc. Change to
> > cd lib/python2.7/site-packages/pipedviewer
> > grep PyQt4 *
> shows you, where the imports are done by ferret. Open for example cmndhelperpq.py with you preferred ascii-editor. You will find lines like the following:
> 
> # First try to import PyQt5, then try PyQt4 if that fails
> try:
>     import PyQt5
>     QT_VERSION = 5
> except ImportError:
>     import PyQt4
>     QT_VERSION = 4
> 
> You may change this to
> # First try to import PyQt4, then try PyQt4 if that fails
> try:
>     import PyQt4
>     QT_VERSION = 4
> except ImportError:
>     import PyQt4
>     QT_VERSION = 4
> 
> Hence, PyQt4 is used solely. Nothing else to be done in this file. There are some more files to be treated similarly.
> 
> I have a ferret version with these changes to produce eps if needed. But this is legathy, not the future.
> 
> Best,
> Martin
> 
>> Am 21.04.2019 um 19:13 schrieb Jian (Tony) Ma:
>> Hi Martin,
>> 
>> I have retained pyqt4 with miniconda2, but still only have pyqt5 when ferret is activated. Pls let me know how to import pyqt4. I tried but unsuccessful.
>> 
>> Thanks,
>> Tony
>> 
>> Sent from my iPhone
>> 
>>> On Apr 20, 2019, at 9:30 PM, Martin Schmidt <martin.schmidt@xxxxxxxxxxxxxxxxx> wrote:
>>> 
>>> Hi Tony,
>>> 
>>> as far as I know the message is correct. I had the same problem some time ago. There is no simple solution at the horizon. The best recommendation would be, to to make friends with other formats like png or pdf.
>>> 
>>> I had searched through several forums on qt. The support of Postcript output was discussed and some of the developpers clearly expressed that Postcript will not be supported any more in future. I cannot simply find the links - just remebering in this as a fact.
>>> 
>>> With linux there is a partial solution to keep eps-output. Most systems, i.e. linux destributions, still deliver qt4. One may install both, qt4 and qt5, in parallel. Qt4 supports eps-output. I am pretty sure, this is also possible for MacOS, but I cannot tell you how. Here you need to ask a Mac-wizzard. The next thing would be to change pyferret a little bit. There are several python scripts (.py-files), importing either PyQt4 or PyQt5. If there is PyQt5 installed, it would be preferred. You would have to edit these files to import the PyQt4 module in any case. Just a few lines to modify.  Even possible without any python knowledge. If you need more details I could help, but in this case please wait until next Tuesday.   So your turn would be to learn, how to keep qt4 and qt5 in parallel on your Mac, no need to downgrade.
>>> 
>>> Best,
>>> 
>>> Martin
>>> 
>>> 
>>> 
>>>> Am 20.04.2019 um 12:24 schrieb Jian (Tony) Ma:
>>>> Dear All,
>>>> 
>>>> I got problem with PyFerret on Mac. When I use frame/file=1.eps, it tells me there is no postscriptformat for QPrinter. I searched online and found this is a problem with qt5, but I cannot downgrade to pyqt4. Any solution? Frustrated!
>>>> 
>>>> Thanks,
>>>> Tony
>>>> 
>>>> Sent from my iPhone
> 



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement