Twint: pip3 install -r requirements.txt fails

Created on 6 Jun 2018  路  10Comments  路  Source: twintproject/twint

Hi,

I just updated to the latest version of Twint and ran pip3 install -r requirements.txt from within the twint-master folder and I get this error (previous version worked OK). Scroll to the bottom to see the error regarding "python setup.py egg_info" : -

pip3 install -r requirements.txt
Requirement already satisfied: aiohttp in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (3.1.3)
Requirement already satisfied: aiodns in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from -r requirements.txt (line 2)) (1.1.1)
Requirement already satisfied: beautifulsoup4 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from -r requirements.txt (line 3)) (4.6.0)
Requirement already satisfied: cchardet in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from -r requirements.txt (line 4)) (2.1.1)
Requirement already satisfied: elasticsearch in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from -r requirements.txt (line 5)) (6.2.0)
Collecting pysocks (from -r requirements.txt (line 6))
  Using cached https://files.pythonhosted.org/packages/53/12/6bf1d764f128636cef7408e8156b7235b150ea31650d0260969215bb8e7d/PySocks-1.6.8.tar.gz
Requirement already satisfied: pandas in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from -r requirements.txt (line 7)) (0.23.0)
Collecting tables (from -r requirements.txt (line 8))
  Using cached https://files.pythonhosted.org/packages/cc/cf/2f6be449880fb2c444f41582a7849ea559466a43aa5220855704d3941753/tables-3.4.3-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting mysqlclient (from -r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz
    Complete output from command python setup.py egg_info:
    /bin/sh: mysql_config: command not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/s2/qhw19mjx5fd4vqzylc5_9yd80000gn/T/pip-install-bpzgru3w/mysqlclient/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "/private/var/folders/s2/qhw19mjx5fd4vqzylc5_9yd80000gn/T/pip-install-bpzgru3w/mysqlclient/setup_posix.py", line 44, in get_config
        libs = mysql_config("libs_r")
      File "/private/var/folders/s2/qhw19mjx5fd4vqzylc5_9yd80000gn/T/pip-install-bpzgru3w/mysqlclient/setup_posix.py", line 26, in mysql_config
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    OSError: mysql_config not found

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/s2/qhw19mjx5fd4vqzylc5_9yd80000gn/T/pip-install-bpzgru3w/mysqlclient/

Most helpful comment

to install the mysql python pack u needed to have mysql installed; i just moved it to a separate branch and put how to install it with mysql in the readme

All 10 comments

I also think related to the above, I can no longer use Twint as it fails, e.g.: -

python3 twint.py -s brexit -o brexit.csv --csv
Traceback (most recent call last):
  File "twint.py", line 12, in <module>
    import twint
  File "/Users/david/Desktop/twint-master/twint/__init__.py", line 11, in <module>
    from . import run
  File "/Users/david/Desktop/twint-master/twint/run.py", line 1, in <module>
    from . import favorites, follow, profile, search
  File "/Users/david/Desktop/twint-master/twint/favorites.py", line 1, in <module>
    from . import feed, get, db, output, verbose, dbmysql
  File "/Users/david/Desktop/twint-master/twint/get.py", line 2, in <module>
    from .output import Tweets, Users
  File "/Users/david/Desktop/twint-master/twint/output.py", line 3, in <module>
    from . import db, elasticsearch, format, write, Pandas, dbmysql
  File "/Users/david/Desktop/twint-master/twint/dbmysql.py", line 2, in <module>
    import MySQLdb
ModuleNotFoundError: No module named 'MySQLdb'
MacBook-Pro-3:twint-master david$ 

If I try to install 'MySQLdb' I get this: -

pip3 install MySQLdb
Collecting MySQLdb
  Could not find a version that satisfies the requirement MySQLdb (from versions: )
No matching distribution found for MySQLdb

OK, it's all fine now. I'm not particularly technical, but realised that I needed to install 'mysql' in order for it to now work.

let me have a look, I did not have this problem when I installed it

Hmm, I had issues on my other laptop; Travis-CI doesn't seem to have any issues

OK, it's all fine now. I'm not particularly technical, but realised that I needed to install 'mysql' in order for it to now work.

This was the proper solution for someone in my DMs.

I think I might move the MySQL outputting to a separate branch

I could not check this problem because I got an error saying that I need a python version above or equal to 3.5.3 for installing the first requisite :( and I am still trying to install version 3.5.4 with no luck :(
Mysql is needed for use the mysql output but if you don't use it it should work without any problem.. At least in theory...

to install the mysql python pack u needed to have mysql installed; i just moved it to a separate branch and put how to install it with mysql in the readme

Taking note

Hi - I have tried to follow all of the fixes but have not been able to get around this.

When running twint (which was working fine 2 weeks ago) I still get the "No module named MySQLdb" error

When I try to install mysql as per the advice above (or any other SQL package) I get the error:

Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-install-_3huyrub/MySQL-python/

Have tried prefixing sudo, have tried updating all setup tools, etc.

I am not an expert, not good at coding, using Mac, IOS.

Would appreciate it if anyone could help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nestor75 picture Nestor75  路  3Comments

wagerpascal picture wagerpascal  路  4Comments

4sakura picture 4sakura  路  3Comments

PatricioAlvarado picture PatricioAlvarado  路  4Comments

dmuth picture dmuth  路  4Comments