简体   繁体   English

在Heroku上找不到parse_rest模块,但在localhost上有效

[英]parse_rest module not found on Heroku, but works on localhost

To access the Parse.com backend, I use their Python sdk . 要访问Parse.com后端,我使用其Python sdk The parse_rest dependency is listed in requirements.txt. parse_rest依赖关系在requirements.txt中列出。 Everything works fine on localhost. 在localhost上一切正常。 On Heroku, I get this error: 在Heroku上,出现以下错误:

2015-01-31T13:34:34.349494+00:00 heroku[web.1]: Starting process with command `python manage.py runserver`
2015-01-31T13:34:36.767611+00:00 app[web.1]: Traceback (most recent call last):
2015-01-31T13:34:36.767628+00:00 app[web.1]:   File "manage.py", line 5, in <module>
2015-01-31T13:34:36.767636+00:00 app[web.1]:   File "/app/app/models.py", line 11, in <module>
2015-01-31T13:34:36.767634+00:00 app[web.1]:     from app.models import User, Role
2015-01-31T13:34:36.767675+00:00 app[web.1]:     from parse_rest.connection import register
2015-01-31T13:34:36.767703+00:00 app[web.1]: ImportError: No module named parse_rest.connection
2015-01-31T13:34:37.739205+00:00 heroku[web.1]: Process exited with status 1
2015-01-31T13:34:37.741006+00:00 heroku[web.1]: State changed from starting to crashed

How can this problem be fixed? 如何解决此问题?


requirements.txt requirements.txt

parse_rest
Authomatic==0.0.10
Flask==0.10.1
Flask-Assets==0.7
Flask-Bootstrap==3.0.3.1
Flask-Login==0.2.7
Flask-Mail==0.9.0
Flask-Migrate==1.1.0
Flask-Moment==0.2.1
Flask-MongoEngine==0.1.3-dev
Flask-OAuth==0.12
Flask-Principal==0.4.0
Flask-SQLAlchemy==1.0
Flask-Script==0.6.6
Flask-Security==1.6.9
Flask-Social==1.6.2
Flask-WTF==0.9.4
GraphLab-Create==1.0
Jinja2==2.7.1
Mako==0.9.1
MarkupSafe==0.18
PAM==0.4.2
Pillow==2.3.0
PyYAML==3.10
SQLAlchemy==0.8.4
Twisted-Core==13.2.0
Twisted-Web==13.2.0
WTForms==1.0.5
Werkzeug==0.9.4
alembic==0.6.2
apiclient==1.0.2
appengine==1.8.0.2
apt-xapian-index==0.45
argparse==1.2.1
backports.ssl-match-hostname==3.4.0.2
blinker==1.3
boto==2.33.0
bottle==0.12.0
chardet==1.0.1
colorama==0.2.5
cssmin==0.1.4
decorator==3.4.0
dirspec==13.10
environment==1.0.0
facebook-sdk==0.3.1
foursquare==20130707
github3.py==0.7.1
google-api-python-client==1.1
gunicorn==0.14.6
html5lib==0.999
httplib2==0.8
itsdangerous==0.23
joblib==0.7.1
jsmin==2.0.2
librato-metrics==0.4.9
lockfile==0.9.1
matplotlib==1.3.1
mixpanel-py==3.1.1
mock==0.8.0
mongoengine==0.8.7
nose==1.1.2
numpy==1.8.2
oauth==1.0.1
oauth2==1.5.211
oauth2client==1.1
oauthlib==0.6.0
paramiko==1.10.1
parse-rest==0.2.20141004
passlib==1.6.1
pexpect==3.1
poster==0.8.1
prettytable==0.7.2
psycopg2==2.5.1
pyOpenSSL==0.13
pyasn1==0.1.7
pyasn1-modules==0.0.5
pycrypto==2.6.1
pycups==1.9.66
pycurl==7.19.3
pygobject==3.12.0
pymongo==2.6.3
pyparsing==2.0.1
pyserial==2.6
python-apt==0.9.3.5
python-daemon==1.6
python-dateutil==1.5
python-debian==0.1.21-nmu2ubuntu2
python-gflags==2.0
python-twitter==1.1
pytz==2012c
reportlab==3.0
requests==2.0.0
requests-oauthlib==0.4.0
rsa==3.1.4
scikit-learn==0.14.1
scipy==0.13.3
simplejson==3.3.1
six==1.9.0
ssh-import-id==3.21
tornado==3.2.1
uritemplate==0.6
uritemplate.py==0.2.0
urllib3==1.6
vboxapi==1.0
virtualenv==1.11.4
webassets==0.7
wsgiref==0.1.2
zope.interface==4.0.5

heroku logs --source heroku --ps api heroku日志--source heroku --ps api

2015-01-31T11:42:12.775108+00:00 heroku[api]: Scale to web=1 by raven.project.mail@gmail.com
2015-01-31T11:49:00.466658+00:00 heroku[api]: Deploy e17c6b0 by raven.project.mail@gmail.com
2015-01-31T11:49:00.466658+00:00 heroku[api]: Release v10 created by raven.project.mail@gmail.com
2015-01-31T11:50:02.685571+00:00 heroku[api]: Scale to web=1 by raven.project.mail@gmail.com
2015-01-31T11:57:22.746654+00:00 heroku[api]: Deploy 1045723 by raven.project.mail@gmail.com
2015-01-31T11:57:22.746654+00:00 heroku[api]: Release v11 created by raven.project.mail@gmail.com
2015-01-31T12:02:22.886402+00:00 heroku[api]: Scale to web=1 by raven.project.mail@gmail.com
2015-01-31T13:27:58.625655+00:00 heroku[api]: Release v12 created by raven.project.mail@gmail.com
2015-01-31T13:27:58.625655+00:00 heroku[api]: Deploy 084c0ed by raven.project.mail@gmail.com
2015-01-31T13:29:46.730378+00:00 heroku[api]: Scale to web=1 by raven.project.mail@gmail.com
2015-01-31T13:34:29.324713+00:00 heroku[api]: Release v13 created by raven.project.mail@gmail.com
2015-01-31T13:34:29.324713+00:00 heroku[api]: Deploy 05a0e2c by raven.project.mail@gmail.com
2015-01-31T13:34:40.077161+00:00 heroku[api]: Scale to web=1 by raven.project.mail@gmail.com

Try installing your requirements locally as well, maybe even in a fresh virtualenv: 也可以尝试在本地安装需求,甚至可以在新的virtualenv中安装:

$ pip install -r requirements.txt

Then you will get the following error: 然后您将得到以下错误:

Double requirement given: parse-rest==0.2.20141004 (from -r requirements.txt (line 68)) (already in parse-rest (from -r requirements.txt (line 1)), name='parse-rest') 给出了双重要求:parse-rest == 0.2.20141004(来自-r requirements.txt(第68行))(已经处于parse-rest(来自-r requirements.txt(第1行)),name ='parse-rest' )

Removing the extraneous package declaration will probably not be enough though. 但是,删除无关的软件包声明可能还不够。 When I tried installing the rest of the packages in your requirements.txt (which is pretty long by the way) a few packages were not found at all. 当我尝试在您的requirements.txt中安装其余软件包时(很长一段时间),根本找不到几个软件包。 Bottle version 0.12.0, for example, seems to have been removed completely from the index ([security issues?[]) and 0.12.1 is the closest. 例如,瓶子版本0.12.0似乎已从索引中完全删除([安全问题?]),而0.12.1是最接近的版本。

You probably ran pip freeze and ended up with a lot of requirements that are not really needed. 您可能会pip freeze ,最终遇到了很多并非真正需要的要求。 Here's a workflow that works well for me: 这是一个很适合我的工作流程:

  • Use virtualenv 使用virtualenv
  • Manage your requirements.txt carefully. 仔细管理您的requirements.txt
  • Use versions, also for secondary dependencies, otherwise your app might suddenly break or behave inconsistently when a package is updated. 使用版本,也用于辅助依赖性,否则在更新软件包时,您的应用可能突然中断或行为不一致。
  • Also use your virtualenv during development, then you will realize when a package is missing from the requirements file or when a package is deprecated. 在开发过程中也使用virtualenv,然后您将意识到需求文件中缺少软件包或不赞成使用软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM