0

I have successfuly installed csvkit using conda install ...

However, when I try to import the libraries in Python 2.7 Spyder, I get error messages:

     import csvsql
     Traceback (most recent call last):

      File "<ipython-input-5-303a60a6b1ac>", line 1, in <module>

     import csvsql

     ImportError: No module named csvsql

     import csvkit
     Traceback (most recent call last):

      File "<ipython-input-7-ca8a99ae9834>", line 1, in <module>
      import csvkit

      ImportError: No module named csvkit

I looked at the documentation -- they describe the installation process but not how the library is loaded in Python.

Moreover, I had an analogous problem with httplib2. I installed it successfuly but when I tried to import it in Spyder I received an analogous error message (No module named httplib2).

(I use Anaconda 3 and Spyder on Windows 11)

Any ideas? Thank you in advance.

im7
  • 653
  • 2
  • 10
  • 28

1 Answers1

0

I asked this question on the csvkit GitHub / issues forum. The answer given was: You should use agate on which csvkit now relies for all its operations. See https://github.com/wireservice/agate.

I'm with you -- it would be wonderful to use csvkit as a command-line tool and a library, but it's authors don't see it that way. The full issue: https://github.com/wireservice/csvkit/issues/670

Chris Johnson
  • 20,650
  • 6
  • 81
  • 80
  • Hi Chris, thanks for your answer. I installed agate using pip as recommended. However, when I tried to import it ("importa agade") in Spyder I got the "usual" error message ("No module named agade"). Moreover, assuming I import agade, what I should do to run csvsql code? My end objective is to create a table in a database using a csv file and import that file in the database. There is a post at Stckoverflow that has a similar example: "createdb test csvsql --db postgresql:///test --table fy09 --insert examples/realdata/FY09_EDU_Recipients_by_State.csv" – im7 Dec 21 '16 at 08:22
  • @im7: typo? You wrote "agade", but instead it should be "agate". – StackzOfZtuff Mar 21 '22 at 13:25