I have been working lately with IRAF/daophot with the PyRAF environment in a 32bit machine and everything is smooth except for the fact that it takes many hours to finish the run in each field I examine. As I would like to finish this analysis as soon as possible I opted to use a 64bit machine (with a larger number of more powerful processors). But still, the daophot task was failing, in particular during the psf task of daophot (when it needs to plot the stars from which you select the stars to create the psf model). The error message was the following:
ERROR (851, “Cannot restore graphics world coordinate systems”)
The same error was raised in both 64bit machines I used (a. PyRAF 2.1.3 and IRAF 2.16.1 in Debian 8, b. PyRAF 2.1.7 and IRAF 2.16.1 in CentOS 7.2), and actually regardless if I used the pyraf or the native cl environment. So the most probable cause should be somehow connected with the 64bit architecture (even though one possibility could be a typo in the iraf/unix/hlib/extpkg.cl file , but this is not the case for these PyRAF versions).
After asking this very question in iraf.net forum  I got an answer from fitz that
The problem happens because in the 64-bit v2.15 port the size of the WCS graphics structure was changed, and a corresponding change was required in pyraf (which is responsible for the graphics the same way the CL is). This bug was fixed in pyraf but apparently only for the 32-bit version
The proposed workaround is to download the 32bit version of daophot (at ) and put it under iraf$noao/bin.linux64 directory. If this is under /iraf (under root) then you need root permissions to copy there and make it executable, preferably as chmod +x x_daophot.e, to make it available for all users in the same machine.
So, we have to keep in mind that the 32bit versions could be the replacement for other non-working tasks as well. Let’s hope that there will be finally future releases of PyRAF .
 STScI / PyRAF FAQ #1.5
 iraf.net/forum: “PyRAF and DAOPHOT – ERROR 851”
 0. Support Status : “Due to reduced budgets for HST, we can only provide minimal pyraf support. If you have a problem that cannot be solved quickly by our first tier support, we may be unable to help. This is unfortunate, but it is the best we can do with the resources available. “,
STScI / PyRAF FAQ #0, accessed 15 March 2016