querycsv-redux icon indicating copy to clipboard operation
querycsv-redux copied to clipboard

Name '[argument]' is not defined

Open K-Mistele opened this issue 6 years ago • 1 comments

Downloading and importing the module works fine. When I try and run it, no matter what arguments I use (-i, -o, etc.), I get an error that says name '[whatever the letter argument is] is not defined. Ex. >>>querycsv -i podcasts.csv -o output.csv [sql command] Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'i' is not defined

K-Mistele avatar Apr 12 '18 01:04 K-Mistele

You have to run the script from the console, and not from the Python interpreter.

Correct:

PS C:\Users\miromart\querycsv-redux> pip install -e .  
Obtaining file:///C:/Users/miromart/Documents/querycsv/querycsv-redux
  Preparing metadata (setup.py) ... done
Installing collected packages: querycsv-redux
  Running setup.py develop for querycsv-redux
Successfully installed querycsv-redux-5.0.0
PS C:\Users\miromart\querycsv-redux> querycsv -i aa.csv  "select * from aa where nombre='david'"
 nombre | edad
===============
 david  | 10

Incorrect:

PS C:\Users\miromart\querycsv-redux> python
Python 3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> querycsv -i podcasts.csv -o output.csv [sql command]   
  File "<stdin>", line 1
    querycsv -i podcasts.csv -o output.csv [sql command]
             ^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

dmiro avatar Jul 15 '22 19:07 dmiro