entrepreneur-interet-general / OpenScraper

An open source webapp for scraping: towards a public service for webscraping
http://www.cis-openscraper.com/
MIT License
92 stars 22 forks source link

ImportError: cannot import name json_util error on install #53

Closed DavidBruant closed 5 years ago

DavidBruant commented 5 years ago

Following the install instructions (except running python main.py from the openscraper directory) lead to the following error:

main.py:410: SyntaxWarning: import * only allowed at module level
  def __init__(self, mode="default"):
Traceback (most recent call last):
  File "main.py", line 24, in <module>
    from    bson import json_util
ImportError: cannot import name json_util

I've seen the same error with and without venv

JulienParis commented 5 years ago

perhaps try to install all python libraries needed in a Linux environment :

 $ sudo apt-get install build-essential libssl-dev libffi-dev python-dev python-psycopg2 python-mysqldb python-setuptools libgnutls-dev libcurl4-gnutls-dev
 $ sudo apt install libcurl4-openssl-dev libssl-dev
 $ sudo apt-get install python-pip 
 $ sudo pip install --upgrade pip 
 $ sudo pip install --upgrade virtualenv 
 $ sudo pip install --upgrade setuptools
JulienParis commented 5 years ago

@DavidBruant is it resolved with those command lines or am I wrong ?

DavidBruant commented 5 years ago

Yes, it's all good now with the updated readme\ Thanks!