pkg_resources.DistributionNotFound: The 'Flask' distribution was not found and is required by Flask-Login
See original GitHub issueFlask_User is breaking the installation on AWS using ElasticBeanStalk. The specific portion of the error log is as follows:
Collecting Flask-User==1.0.1.3 (from -r /opt/python/ondeck/app/requirements.txt (line 16))
Using cached https://files.pythonhosted.org/packages/fd/e6/092c5c74251372568665f59e4df78d3450992289d5023e2abb77eee7b905/Flask-User-1.0.1.3.tar.gz
Complete output from command python setup.py egg_info:
Installed /tmp/pip-build-k2s8h7v3/Flask-User/.eggs/Flask_Login-0.4.1-py3.6.egg
Searching for Flask
Downloading https://files.pythonhosted.org/packages/c1/ff/bd9a4d2d81bf0c07d9e53e8cd3d675c56553719bbefd372df69bf1b3c1e4/Flask-Login-0.4.1.tar.gz#sha256=c815c1ac7b3e35e2081685e389a665f2c74d7e077cb93cecabaea352da4752ec
Best match: Flask Login-0.4.1
Processing Flask-Login-0.4.1.tar.gz
Writing /tmp/easy_install-wwxz50l_/Flask-Login-0.4.1/setup.cfg
Running Flask-Login-0.4.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-wwxz50l_/Flask-Login-0.4.1/egg-dist-tmp-qnbi69bv
removing '/tmp/pip-build-k2s8h7v3/Flask-User/.eggs/Flask_Login-0.4.1-py3.6.egg' (and everything under it)
creating /tmp/pip-build-k2s8h7v3/Flask-User/.eggs/Flask_Login-0.4.1-py3.6.egg
Extracting Flask_Login-0.4.1-py3.6.egg to /tmp/pip-build-k2s8h7v3/Flask-User/.eggs
Installed /tmp/pip-build-k2s8h7v3/Flask-User/.eggs/Flask_Login-0.4.1-py3.6.egg
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-k2s8h7v3/Flask-User/setup.py", line 87, in <module>
tests_require=['pytest'],
File "/usr/lib64/python3.6/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/dist.py", line 315, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
replace_conflicting=True,
File "/opt/python/run/venv/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 853, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'Flask' distribution was not found and is required by Flask-Login
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-k2s8h7v3/Flask-User/
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
2019-01-09 07:00:25,743 ERROR Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1
Traceback (most recent call last):
File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
install_dependencies()
File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
File "/usr/lib64/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1.
Any help on the issue would be appreciated. It seems flask_user is unable to identify the existing installation of Flask library.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
"distribution was not found and is required by the application ...
I noticed that when I'd pip install my package, in site-packages the name of the egg-info directory (or dist-info perhaps in your case)...
Read more >Flask-User - Bountysource
... raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'Flask' distribution was not found and is required by Flask-Login ...
Read more >Flask-User - PyPI
You start with a simple Login page, but soon enough you'll need to handle: Registrations and Email Confirmations. Change Usernames, Change Passwords, and ......
Read more >pkg_resources.DistributionNotFound: The 'bench==4.1.0 ...
pkg_resources.DistributionNotFound: The 'bench==4.1.0' distribution was not found and is required by the application.
Read more >[GitHub] [superset] gfelot opened a new issue #16717
... sqlalchemy-utils, wtforms-json, Flask-Login, Flask-JWT-Extended, ... -packages/pkg_resources/__init__.py", line 900, in require needed ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Update: I forked to here: https://github.com/wayne-li2/Flask-User And uploaded to PyPi under ‘Flask-User-AWS==1.0.1.7’ (pip install Flask-User-AWS) And the Elastic Beanstalk build passed. I tried moving Flask to the bottom of ‘install_requires’ but that didn’t work. Then I tried that + remove ‘Flask-Login’ from setup_requires, and that seemed to work. However, I have no idea how breaking this will be for Flask-User itself. So use with caution.
A bit late, so merely for future readers: it seems that specifying any version may solve this, so: specifying the current version may be doing the trick as well.
https://github.com/pypa/setuptools/issues/498