我将项目配置为使用Django但部署时出现以下错误:
-----> Python app detected
-----> Installing python-3.6.4
-----> Installing pip
Traceback (most recent call last):
File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pipenv-to-pip", line 23, in <module>
main()
File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pipenv-to-pip", line 11, in main
lockfile = json.load(f)
File "/app/.heroku/python/lib/python3.6/json/__init__.py", line 299, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/app/.heroku/python/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/app/.heroku/python/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/app/.heroku/python/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)
! Push rejected, failed to compile Python app.
! Push failed
当我尝试安装模块时会出现同样的问题&#34; gunicorn &#34;和&#34; django-heroku &#34;通过&#34; pipenv &#34;。但是,当我只使用&#34; pip3 &#34;它是以usuall安装的。
Pipfile的内容:
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
[dev-packages]
[requires]
python_version = "3.6.4"
Pipfile.lock的内容:
[requires]
python_full_version = "3.6.4"
答案 0 :(得分:0)
我通过先删除BOOL WINAPI MyHandlerRoutine(DWORD dwCtrlType)
{
if (dwCtrlType == CTRL_CLOSE_EVENT)
{
//...
}
return FALSE;
}
int main()
{
SetConsoleCtrlHandler(&MyHandlerRoutine, TRUE);
//...
SetConsoleCtrlHandler(&MyHandlerRoutine, FALSE);
return 0;
}
然后删除Pipfile.lock
来解决此问题
或pipenv install -r requirements.txt
(如果存在pipenv install