smartexpert
smartexpert

Reputation: 3035

Running Python script from Ubuntu terminal NameError

I have recently moved from Python on Windows to Python on Ubuntu. In Windows I could just hit F5 in the IDLE editor to run the script. However, in Ubuntu I have to run the script by typing python /path/to/file.py to execute.

The thing is it seems the imports within the file are not working when I run from command line.

It gives me the error:

NameError: global name 'open_file' is not defined

This is the open_file method of Pytables. In the python file I have:

from tables import *

I have made the file executable and all.

Appreciate your help.

Upvotes: 0

Views: 560

Answers (1)

tdelaney
tdelaney

Reputation: 77347

The pytables on my ubuntu system is 2.3.1. I think that open_file is a version 3 thing. I'm not sure where you can pick up the latest package, but you could always install the latest with pip.

Upvotes: 2

Related Questions