4

私は Heroku ウォークスルーを行っています: https://devcenter.heroku.com/articles/django#prerequisites for python developers. "git push heroku master" を実行しようとするとエラーが発生します。 Deploy to Heroku」セクションは、ページの 1/3 ほど下にあります。次のトレースバックを取得します。

Counting objects: 11, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (11/11), 3.71 KiB, done.
Total 11 (delta 0), reused 0 (delta 0)
-----> Python/Django app detected
-----> Preparing Python interpreter (2.7.2)
-----> Creating Virtualenv (1.8.4)
       Also creating executable in .heroku/venv/bin/python
       Installing distribute...done.
       Installing pip...done.
       Running virtualenv with interpreter /usr/local/bin/python2.7
-----> Installing dependencies using pip (1.1)
       Exception:
       Traceback (most recent call last):
         File "/tmp/build_21leaqqhryfxe/.heroku/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py",
line 104, in main
           status = self.run(options, args)
         File "/tmp/build_21leaqqhryfxe/.heroku/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.
py", line 219, in run
           for req in parse_requirements(filename, finder=finder, options=options):
         File "/tmp/build_21leaqqhryfxe/.heroku/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 128
8, in parse_requirements
           req = InstallRequirement.from_line(line, comes_from)
         File "/tmp/build_21leaqqhryfxe/.heroku/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 85,
 in from_line
           elif os.path.isdir(path) and (os.path.sep in name or name.startswith('.')):
         File "/tmp/build_21leaqqhryfxe/.heroku/venv/lib/python2.7/genericpath.py", line 41, in isdir
           st = os.stat(s)
       TypeError: must be encoded string without NULL bytes, not str

       Storing complete log in /app/.pip/pip.log
 !     Heroku push rejected, failed to compile Python/django app

To git@heroku.com:stark-fortress-9694.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:stark-fortress-9694.git'

他のすべては、この時点まで正常に機能していました。洞察はありますか?私はこれに完全に慣れていません。事前に助けてくれてありがとう。

requirements.txt は次のようになります。

Django==1.4.3
distribute==0.6.31
dj-database-url==0.2.1
psycopg2==2.4.5
4

1 に答える 1

12

ファイルのエンコーディングに問題があると思いrequirements.txtます。おそらく、知らずに Unicode 形式で保存したのでしょう。ANSI 形式で保存する必要があります。詳細については、次のリンクを参照してください: http://georgik.sinusgear.com/2012/08/20/problems-with-deploying-heroku-django-app-from-windows/

于 2012-12-16T03:32:16.223 に答える