3

Here's my file in full:

import time

When I run it, or any import statement, I get:

import: unable to open X server `' @ error/import.c/ImportImageCommand/366.

I'm running it from an ssh into a virtual machine running Ubuntu 12.04.03. python is v2.7. When I run the script in the terminal with the Ubuntu UI, I get a cross hair mouse cursor like it wants a screen capture. When I click, the program ends.

Why would import time access some kind of UI feature?

The scripts I'm trying to write/run are basic text processing and number crunching command line tools. no UI features needed.

Thanks!

ZdaR
  • 22,343
  • 7
  • 66
  • 87
user1933275
  • 481
  • 1
  • 5
  • 9
  • 2
    Can you try just importing one function? For example, from time import time –  Jun 22 '15 at 23:54
  • 4
    Are you sure you're typing `import` at the *Python* interactive shell and not at the terminal shell prompt? I think you're running the http://linux.die.net/man/1/import command from a shell prompt. Or that your `.py` script doesn't have the right `#! /bin/env python` line at the start and isn't being run in Python – TessellatingHeckler Jun 22 '15 at 23:54
  • tried from time import time, got "from: can't read /var/mail/time" – user1933275 Jun 23 '15 at 00:16
  • looks like this was the problem: I wasn't running it through python. this answer cleared it up [link](http://stackoverflow.com/questions/16069816/getting-python-error-from-cant-read-var-mail-bio) – user1933275 Jun 23 '15 at 00:29

0 Answers0