Skip to main content
 首页 » 编程设计

python之Flask 安装中缺少文件

2025年05月04日7wuhuacong

我已经尝试了很长时间来安装 Flask。

每次我遇到同样的错误时,我都会收到以下警告,指出没有以前包含的文件。我不确定如何绕过它,因为它似乎会干扰我接下来需要或想要做的任何事情。

我遵循了基本的 heroku tutorial成功直到我不得不推送 git,但它失败了。非常感谢任何帮助。

(venv)Shahs-MacBook-Pro:helloflask ssaullah$ pip install Flask gunicorn 
 
Downloading/unpacking Flask 
  Downloading Flask-0.10.1.tar.gz (544kB): 544kB downloaded 
  Running setup.py egg_info for package Flask 
 
    warning: no files found matching '*' under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 'docs' 
    warning: no previously-included files matching '*.pyc' found under directory 'tests' 
    warning: no previously-included files matching '*.pyo' found under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 'examples' 
    warning: no previously-included files matching '*.pyo' found under directory 'examples' 
    no previously-included directories found matching 'docs/_build' 
    no previously-included directories found matching 'docs/_themes/.git' 
Downloading/unpacking gunicorn 
  Downloading gunicorn-0.17.4.tar.gz (372kB): 372kB downloaded 
  Running setup.py egg_info for package gunicorn 
 
Downloading/unpacking Werkzeug>=0.7 (from Flask) 
  Downloading Werkzeug-0.9.1.tar.gz (1.1MB): 1.1MB downloaded 
  Running setup.py egg_info for package Werkzeug 
 
    warning: no files found matching '*' under directory 'werkzeug/debug/templates' 
    warning: no files found matching '*' under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 'docs' 
    warning: no previously-included files matching '*.pyc' found under directory 'tests' 
    warning: no previously-included files matching '*.pyo' found under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 'examples' 
    warning: no previously-included files matching '*.pyo' found under directory 'examples' 
    no previously-included directories found matching 'docs/_build' 
Downloading/unpacking Jinja2>=2.4 (from Flask) 
  Downloading Jinja2-2.7.tar.gz (377kB): 377kB downloaded 
  Running setup.py egg_info for package Jinja2 
 
    warning: no files found matching '*' under directory 'custom_fixers' 
    warning: no previously-included files matching '*' found under directory 'docs/_build' 
    warning: no previously-included files matching '*.pyc' found under directory 'jinja2' 
    warning: no previously-included files matching '*.pyc' found under directory 'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 'jinja2' 
    warning: no previously-included files matching '*.pyo' found under directory 'docs' 
Downloading/unpacking itsdangerous>=0.21 (from Flask) 
  Downloading itsdangerous-0.21.tar.gz 
  Running setup.py egg_info for package itsdangerous 
 
Downloading/unpacking markupsafe (from Jinja2>=2.4->Flask) 
  Downloading MarkupSafe-0.18.tar.gz 
  Running setup.py egg_info for package markupsafe 
 
Installing collected packages: Flask, gunicorn, Werkzeug, Jinja2, itsdangerous, markupsafe 
  Running setup.py install for Flask 
 
    warning: no files found matching '*' under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 'docs' 
    warning: no previously-included files matching '*.pyc' found under directory 'tests' 
    warning: no previously-included files matching '*.pyo' found under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 'examples' 
    warning: no previously-included files matching '*.pyo' found under directory 'examples' 
    no previously-included directories found matching 'docs/_build' 
    no previously-included directories found matching 'docs/_themes/.git' 
  Running setup.py install for gunicorn 
 
    Installing gunicorn_paster script to /Users/ssaullah/Desktop/tryweb/helloflask/venv/bin 
    Installing gunicorn script to /Users/ssaullah/Desktop/tryweb/helloflask/venv/bin 
    Installing gunicorn_django script to /Users/ssaullah/Desktop/tryweb/helloflask/venv/bin 
  Running setup.py install for Werkzeug 
 
    warning: no files found matching '*' under directory 'werkzeug/debug/templates' 
    warning: no files found matching '*' under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 'docs' 
    warning: no previously-included files matching '*.pyc' found under directory 'tests' 
    warning: no previously-included files matching '*.pyo' found under directory 'tests' 
    warning: no previously-included files matching '*.pyc' found under directory 'examples' 
    warning: no previously-included files matching '*.pyo' found under directory 'examples' 
    no previously-included directories found matching 'docs/_build' 
  Running setup.py install for Jinja2 
 
    warning: no files found matching '*' under directory 'custom_fixers' 
    warning: no previously-included files matching '*' found under directory 'docs/_build' 
    warning: no previously-included files matching '*.pyc' found under directory 'jinja2' 
    warning: no previously-included files matching '*.pyc' found under directory 'docs' 
    warning: no previously-included files matching '*.pyo' found under directory 'jinja2' 
    warning: no previously-included files matching '*.pyo' found under directory 'docs' 
  Running setup.py install for itsdangerous 
 
  Running setup.py install for markupsafe 
 
    building 'markupsafe._speedups' extension 
    /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c markupsafe/_speedups.c -o build/temp.macosx-10.3-fat-2.7/markupsafe/_speedups.o 
    /usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -g build/temp.macosx-10.3-fat-2.7/markupsafe/_speedups.o -o build/lib.macosx-10.3-fat-2.7/markupsafe/_speedups.so 
Successfully installed Flask gunicorn Werkzeug Jinja2 itsdangerous markupsafe 
Cleaning up... 

编辑:

我应该包括这个:在教程结束时尝试推送 git 时出现的错误。

Shahs-MacBook-Pro:helloflask ssaullah$ git push heroku master 
Counting objects: 6, done. 
Delta compression using up to 8 threads. 
Compressing objects: 100% (4/4), done. 
Writing objects: 100% (6/6), 731 bytes, done. 
Total 6 (delta 0), reused 0 (delta 0) 
 
-----> Python app detected 
-----> No runtime.txt provided; assuming python-2.7.4. 
-----> Preparing Python runtime (python-2.7.4) 
-----> Installing Distribute (0.6.36) 
-----> Installing Pip (1.3.1) 
-----> Installing dependencies using Pip (1.3.1) 
       Downloading/unpacking Django==1.5.1 (from -r requirements.txt (line 1)) 
         Running setup.py egg_info for package Django 
 
       Downloading/unpacking Flask==0.9 (from -r requirements.txt (line 2)) 
         Running setup.py egg_info for package Flask 
 
           warning: no files found matching '*' under directory 'tests' 
           no previously-included directories found matching 'docs/_build' 
           no previously-included directories found matching 'docs/_themes/.git' 
       Downloading/unpacking Jinja2==2.6 (from -r requirements.txt (line 3)) 
         Running setup.py egg_info for package Jinja2 
 
       Downloading/unpacking Polygon==2.0.1 (from -r requirements.txt (line 4)) 
         Could not find a version that satisfies the requirement Polygon==2.0.1 (from -r requirements.txt (line 4)) (from versions: 3.0.5, 3.0.4a-src, 2.0.5, 2.0.4.macosx-10.6-universal, 2.0.4) 
       No distributions matching the version for Polygon==2.0.1 (from -r requirements.txt (line 4)) 
       Storing complete log in /app/.pip/pip.log 
 
 !     Push rejected, failed to compile Python app 
 
To git@heroku.com:immense-waters-4799.git 
 ! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'git@heroku.com:immense-waters-4799.git' 

请您参考如下方法:

这个 ( https://pypi.python.org/pypi/Polygon/ ) 是指向 PyPi 上多边形的链接。您可以在其后附加版本号以检索相应版本的 Polygon 的 url(例如 https://pypi.python.org/pypi/Polygon/3.0.5)。使用 2.0.1 给我一个未找到的页面 ( https://pypi.python.org/pypi/Polygon/2.0.1 )。您可能想要找到合适的版本,例如 2.0.3 、 2.0.4 或 2.0.5 。

PyPi 上的链接页面: https://pypi.python.org/simple/Polygon/

Polygon2 的 github 存储库:https://github.com/jraedler/Polygon2

希望对您有所帮助。