2017-07-18 95 views
4

關於stackoverflow的第一個問題:D(因爲我發現幾乎所有的東西)。在heroku上部署python燒瓶應用程序給functools32提供了錯誤

我嘗試部署我的Python應用的Heroku,但出現以下錯誤:

git push heroku master 
Counting objects: 7036, done. 
Compressing objects: 100% (3933/3933), done. 
Writing objects: 100% (7036/7036), 10.97 MiB | 338.00 KiB/s, done. 
Total 7036 (delta 2020), reused 7021 (delta 2014) 
remote: Compressing source files... done. 
remote: Building source: 
remote: 
remote: -----> Python app detected 
remote: -----> Installing python-3.6.2 
remote: -----> Installing pip 
remote: -----> Installing requirements with pip 
remote:  Collecting aniso8601==1.2.1 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 1)) 
remote:   Downloading aniso8601-1.2.1.tar.gz (62kB) 
remote:  Collecting click==6.7 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 2)) 
remote:   Downloading click-6.7-py2.py3-none-any.whl (71kB) 
remote:  Collecting cycler==0.10.0 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 3)) 
remote:   Downloading cycler-0.10.0-py2.py3-none-any.whl 
remote:  Collecting deap==1.0.2.post2 (from -r 
remote:  Collecting Flask==0.12.2 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 5)) 
remote:   Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB) 
remote:  Collecting Flask-RESTful==0.3.6 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 6)) 
remote:   Downloading Flask_RESTful-0.3.6-py2.py3-none-any.whl 
remote:  Collecting functools32==3.2.3.post2 (from -r /tmp/build_3d7108e037a9a8803be5100bdc092768/requirements.txt (line 7)) 
remote:   Downloading functools32-3.2.3-2.zip 
remote:   Complete output from command python setup.py egg_info: 
remote:   This backport is for Python 2.7 only. 
remote:    
remote:   ---------------------------------------- 
remote:  Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-l0v0636d/functools32/ 
remote: !  Push rejected, failed to compile Python app. 
remote: 
remote: !  Push failed 
remote: Verifying deploy... 
remote: 
remote: ! Push rejected to XXXXXXX (servername by Heroku). 
remote: 

在我的虛框一切工作正常,如果我做

pip install -r requirements.txt 

我試着不帶以下果:

  • 改變functools32版本
  • 個從需求的文字,這讓我意識到它刪除functools是瓶中裝飾:(
+3

上面的回溯說'這個backport僅適用於Python 2.7',但是你使用的python3已經內置了'functools'模塊.AFAIK'functools'不是燒瓶依賴項,但你可能已經使用過在您的燒瓶應用程序中的2.7回程,可能是這個問題! – dimmg

+1

'functools32'不是Flask對任何受支持的Python版本的依賴。如果你不直接在'requirements.txt'中包含它,Pip會告訴你依賴關係來自哪裏。這種依賴從何而來? – davidism

回答

0

答案的依賴(多虧了註釋): 我不知道,我再次使用Python 2.7版(我我是一名初學者)在我的virtualenv。似乎使用functools在某處自動安裝了functools32軟件包,它將python 3中的functools移植到2. Heroku默認使用python 3,所以這就是爲什麼functools32可能不可用。

由於this post,我現在安裝了一個python 3虛擬環境,移植了我從2到3移植的幾件東西,所有東西都像魅力一樣。

感謝davidism &昏暗指向我正確的方向。

相關問題