infobyte / faraday

Open Source Vulnerability Management Platform
https://www.faradaysec.com
GNU General Public License v3.0
5.03k stars 915 forks source link

cannot import name want_bytes #299

Closed milevyo closed 6 years ago

milevyo commented 6 years ago

Issue Type

Faraday version

from file 'VERSION' 3.2

Component Name

python manage.py initdb

Steps to reproduce

  1. clean install of ubuntu-server version "Ubuntu 16.04.5 LTS"
  2. install system dependencies
  3. install python dependencies
  4. execute python manage.py

Expected results

No Errors?

Environment information

requirements_freeze.txt

Configuration files

none

Reports/Extra data

user@Faraday:~/faraday$ python manage.py initdb
/home/user/.local/lib/python2.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2                                                                                              wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip                                                                                              install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-                                                                                             install-from-pypi>.
  """)
Traceback (most recent call last):
  File "manage.py", line 19, in <module>
    from server.commands.app_urls import show_all_urls
  File "/home/user/faraday/server/commands/app_urls.py", line 7, in <module>
    from server.web import app
  File "/home/user/faraday/server/web.py", line 31, in <module>
    from server.app import create_app
  File "/home/user/faraday/server/app.py", line 36, in <module>
    from flask_session import Session
  File "/home/user/.local/lib/python2.7/site-packages/flask_session/__init__.py", line 16, in <mod                                                                                             ule>
    from .sessions import NullSessionInterface, RedisSessionInterface, \
  File "/home/user/.local/lib/python2.7/site-packages/flask_session/sessions.py", line 23, in <mod                                                                                             ule>
    from itsdangerous import Signer, BadSignature, want_bytes
ImportError: cannot import name want_bytes

OS

$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION="Ubuntu 16.04.5 LTS"

llazzaro commented 6 years ago

It's Dangerous 1.0.0 was recently released. The temporary solution is downgrade itsdangerous until flask-session project supports latest version of it's dangerous.

pip install 'itsdangerous<1.0.0'

To follow up flask session issue check here https://github.com/fengsp/flask-session/issues/89

milevyo commented 6 years ago

things that i did that make things to work

actions i did in order:

  1. pip install 'itsdangerous<1.0.0' --- as advised somewhere in stackoverflow.com ---
  2. pip install 'itsdangerous==0.23'
  3. pip2 uninstall 'itsdangerous'

then it works!

montive commented 6 years ago

Great to read that! Thanks for sending the instructions.

davidism commented 6 years ago

itsdangerous 1.1.0 was just released and contains a fix for this. Flask-Session should still be fixed so it doesn't rely on this, but it won't fail for now. You can unpin the requirement, or at least pin to itsdangerous~=1.1.0 instead.

llazzaro commented 6 years ago

@davidism thanks for the news. We will update the requirements file

milevyo commented 6 years ago

thank you @davidism , i will confirm this later after i test it.