6

Done with :

  • java -jar tika-server-path --port xxxx
  • pip install tika (virtualenv)

parser-tika.py

  import tika 
  from tika import parser 
  parsed = parser.from_file('/path/to/file')
  print parsed["metadata"]
  print parsed["content"]

error : ImportError: cannot import name parser

env setup:

TIKA_VERSION=1.13.1
TIKA_SERVER_JAR=~/parserDev/tika/tika-server-1.13.jar
TIKA_SERVER_ENDPOINT=http://localhost:8989/tika
Aswin
  • 349
  • 4
  • 16

1 Answers1

1

You can't have a file called tika.py in the current directory because that's the name of a different tika you are trying to import.

Simply rename your file.

dagelf
  • 1,468
  • 1
  • 14
  • 25