Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

To install Tk, you need an X display

by ambrus (Abbot)
on Feb 20, 2006 at 12:53 UTC ( [id://531392]=perlmeditation: print w/replies, xml ) Need Help??

This is just a quick note so that others don't fall to the same error as I did, or if they do, they would find this meditation.

I was trying to install the Tk module from the cpan shell, and got test failures.

I've now found out why. When the test run, they try to pop up Tk windows to the screen. If there is no X display, it can't do that. So the fix very simple: run the cpan command from an xterm (not from the console) so that it would find the X display. When I did that, it installed cleany.

Replies are listed 'Best First'.
Re: To install Tk, you need an X display
by merlyn (Sage) on Feb 20, 2006 at 13:52 UTC
    Or install it without testing. It's not a sin to do that. {grin}

    The recent CPAN::Shell added "notest" to the flags, so you can say "notest install Tk". Cool. Use it sparingly, but use it when you need it.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

Re: To install Tk, you need an X display
by gloryhack (Deacon) on Feb 20, 2006 at 22:32 UTC
    You might find that this can also happen if your X session is owned by a normal user who's su'd to root to do the installation. If this scenario bites you and you don't want to start another X session, just ssh as root to localhost with X exported (if your machine is configured to allow X exports via SSH) then perform the installation.

    There's probably a cleaner way to do this, but I've never sought it out.

      In fact, that's what I did. I started X as a user, and su-ed to root in an xterm, and the installation did work.

Re: To install Tk, you need an X display
by converter (Priest) on Feb 21, 2006 at 02:37 UTC
    Xvfb is a great tool for emulation of an X server environment for testing. This readme includes example usage.

    NOTE: corrected link to Xvfb man page

      Your link seems to be broken (404). (Update: it works now.)

      However, from what you're saying, that sounds like vnc. I have vncserver already installed and working on my machine, and it's also easy to start another real X server on a different console if I want to do a test like this. Does Xvfb have any advantage over these?

        Xvfb is not like vnc at all. From the Description section of the man page:

        Xvfb is an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory.
        The primary use of this server was intended to be server testing. The fb code for any depth can be exercised with this server without the need for real hardware that supports the desired depths. The X community has found many other novel uses for Xvfb, including testing clients against unusual depths and screen configurations, doing batch processing with Xvfb as a background rendering engine, load testing, as an aid to porting the X server to a new platform, and providing an unobtrusive way to run applications that don't really need an X server but insist on having one anyway.
Re: To install Tk, you need an X display
by Anonymous Monk on Feb 21, 2006 at 06:02 UTC
Re: To install Tk, you need an X display
by DrHyde (Prior) on Feb 22, 2006 at 10:34 UTC
    Sometimes, stuff that "requires" X doesn't really, it just requires that you set the DISPLAY variable - eg, if an application has both GUI and CLI versions, the installer might be a bit dim but the CLI version will work just fine without X. I've found that trick very useful on a couple of occasions, and used it on machines which don't even have any X libraries installed.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://531392]
Approved by wfsp
Front-paged by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-03-29 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found