littlecodersh / MyPlatform

文科生也会配的微信个人号后台,Content based wechat massive platform framework, what you need to do is only adding your articles in :)
139 stars 53 forks source link

关于在heroku上的部署问题 #4

Closed Malxi closed 8 years ago

Malxi commented 8 years ago

2016-09-20T08:03:32.269749+00:00 app[web.1]: from itsdangerous import json as _json

2016-09-20T08:03:32.269704+00:00 app[web.1]: from . import json, cli

2016-09-20T08:03:32.269751+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/itsdangerous.py", line 14, in

2016-09-20T08:03:32.269787+00:00 app[web.1]: import hmac

2016-09-20T08:03:32.269791+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/hmac.py", line 8, in

2016-09-20T08:03:32.269828+00:00 app[web.1]: from operator import _compare_digest as compare_digest

2016-09-20T08:03:32.269851+00:00 app[web.1]: ImportError: cannot import name _compare_digest

重新虚拟了一个python环境,部署也成功了。但是在本地运行正常,放到上边就出问题了。。。

littlecodersh commented 8 years ago

@Malxi 没有用过,hmac是heroku的环境特有的文件吗?

Malxi commented 8 years ago

@littlecodersh hamc 是 python 中的一个模块。。。好像,这里是在itsdangerous.py中导入了这个模块

Malxi commented 8 years ago

@littlecodersh http://stackoverflow.com/questions/26535043/python-flask-error-importerror-cannot-import-name-compare-digest

littlecodersh commented 8 years ago

@Malxi 现在修复了这个问题了么?

Malxi commented 8 years ago

@littlecodersh 没有,我尝试让它在云上安装hashlib, hmac (这两个是自带的模块。。。) 然后就无法安装了。。。 -----> Python app detected

 $ pip install -r requirements.txt

   Collecting hashlib==20081119 (from -r requirements.txt (line 3))

     Downloading hashlib-20081119.zip (42kB)

       Complete output from command python setup.py egg_info:

       Traceback (most recent call last):

         File "<string>", line 1, in <module>

         File "build/bdist.linux-x86_64/egg/setuptools/__init__.py", line 11, in <module>

         File "build/bdist.linux-x86_64/egg/setuptools/extern/__init__.py", line 1, in <module>

         File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 35, in <module>

         File "/app/.heroku/python/lib/python2.7/email/parser.py", line 12, in <module>

           from email.feedparser import FeedParser

         File "/app/.heroku/python/lib/python2.7/email/feedparser.py", line 27, in <module>

           from email import message

         File "/app/.heroku/python/lib/python2.7/email/message.py", line 16, in <module>

           import email.charset

         File "/app/.heroku/python/lib/python2.7/email/charset.py", line 13, in <module>

           import email.base64mime

         File "/app/.heroku/python/lib/python2.7/email/base64mime.py", line 40, in <module>

           from email.utils import fix_eols

         File "/app/.heroku/python/lib/python2.7/email/utils.py", line 27, in <module>

           import random

         File "/app/.heroku/python/lib/python2.7/random.py", line 49, in <module>

           import hashlib as _hashlib

         File "hashlib.py", line 115, in <module>

           f()

       TypeError: 'frozenset' object is not callable
Malxi commented 8 years ago

解决了,犯了个愚蠢的错误。。。

littlecodersh commented 8 years ago

@Malxi OK,分享一下解决方法吗?

Malxi commented 8 years ago

@littlecodersh 。。。我就一渣渣,看看部署的教程就可以了。

littlecodersh commented 8 years ago

也行吧,那我把这个issue关掉了