IBM QRadar SOAR

IBM QRadar

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  twython install error

    Posted Thu June 11, 2020 07:25 AM
    Dear Community,

    I need to install twython for Twitter app for Resilient and it fails.
    Here is the error message:
    pip install twython
    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    Collecting twython
    Using cached twython-3.8.2.tar.gz (373 kB)
    ERROR: Command errored out with exit status 1:
    command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xMmw8X/twython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xMmw8X/twython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-JHQUsz
    cwd: /tmp/pip-install-xMmw8X/twython/
    Complete output (5 lines):
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-xMmw8X/twython/setup.py", line 33, in <module>
    long_description=open('README.md', encoding='utf-8').read() + '\n\n' +open('HISTORY.md', encoding='utf-8').read(),
    TypeError: 'encoding' is an invalid keyword argument for this function
    ----------------------------------------
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

    What could cause this?

    Thank you.

    Regards,
    Adam

    ------------------------------
    Adam
    ------------------------------


  • 2.  RE: twython install error

    Posted Thu June 11, 2020 08:51 AM
    Hi Adam,
    Thank you for raising this in the community. 

    I took a look at this and I think I know what is happening. 
    In your case you are doing this integration setup on Python 2 and the Twitter app depends on the twython package for interacting with Twitter.
    As of twython 3.8, Python 2 support has been broken/dropped and I think this could be why your failure is happening. 
    Here is a link to an associated github issue : https://github.com/ryanmcgrath/twython/issues/533
    From that issue it looks like it is known and may be fixed in future

    For now, there are 2 fixes I could suggest in the near term. 
    1: In the setup.py of Twitter App; Pin the twython library to something lower than 3.8 if continuing to use Python 2
    2: Switch to python 3 which should not throw up this issue


    Let me know if the above works for you or if something comes up ! 





    ------------------------------
    Ryan Gordon
    Security Software Engineer
    IBM
    ------------------------------



  • 3.  RE: twython install error

    Posted Fri June 12, 2020 06:32 AM
    Hi Ryan,

    That was the problem.
    Thank you.

    Regards,
    Adam

    ------------------------------
    Adam
    ------------------------------