2012-03-10 177 views
2

我試圖在Heroku上部署django項目。我使用virtualenv和pip來管理依賴關係。 virtualenv版本是1.7.1,它附帶的pip是1.1。我試圖強制--no-site-packages,但它現在提示它是默認行爲。另外我確定我在虛擬環境中安裝了所有東西。 Django項目是空的。我按照說明here。也許問題是他們的pip和virtualenv版本比較老?有沒有人遇到過這個問題?先謝謝你。Heroku中的Django項目無法安裝pip的依賴關係

ψ pip.exe freeze 
Django==1.3.1 
distribute==0.6.24 
versiontools==1.8.3 
(venv) 

ψ more .\requirements.txt 
Django==1.3.1 
distribute==0.6.24 
versiontools==1.8.3 

(venv) 

ψ git push heroku master 
Enter passphrase for key '/c/Program Files (x86)/Vim/.ssh/id_rsa': 
Counting objects: 12, done. 
Delta compression using up to 2 threads. 
Compressing objects: 100% (10/10), done. 
Writing objects: 100% (12/12), 3.30 KiB, done. 
Total 12 (delta 2), reused 0 (delta 0) 

-----> Heroku receiving push 
-----> Python/Django app detected 
-----> Preparing virtualenv version 1.7 
     New python executable in ./bin/python 
     Installing distribute.............................................................................................................................................................................................done. 
     Installing pip...............done. 
-----> Activating virtualenv 
-----> Installing dependencies using pip version 1.0.2 
     Exception: 
     Traceback (most recent call last): 
     File "/tmp/build_k6zl66ydgqxp/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/basecommand.py", line 126, in main 
      self.run(options, args) 
     File "/tmp/build_k6zl66ydgqxp/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/commands/install.py", line 200, in run 
      for req in parse_requirements(filename, finder=finder, options=options): 
     File "/tmp/build_k6zl66ydgqxp/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/req.py", line 1255, in parse_requirements 
      req = InstallRequirement.from_line(line, comes_from) 
     File "/tmp/build_k6zl66ydgqxp/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/req.py", line 82, in from_line 
      elif os.path.isdir(path) and (os.path.sep in name or name.startswith('.')): 
     File "/tmp/build_k6zl66ydgqxp/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 
+0

您可以發佈您requirements.txt還有嗎? – 2012-03-10 11:59:53

+0

@Sam是的。現在完成。 – ilcredo 2012-03-10 12:02:59

+0

@Sam其實我在想OS系列的結局。我在Windows 7上,如果他們使用一些POSIX操作系統,但他們沒有提到這是教程。 – ilcredo 2012-03-10 12:05:47

回答

7

它似乎是在requirements.txt這個問題,我使用PowerShell和「pip.exe凍結> requirements.txt」命令, 它創建與具有nullbytes名稱中的文件創建它它。 我能夠通過從github上的示例項目下載requirements.txt並修改它來解決此問題。 這樣做的工作,一切都很好。

+0

請關閉qusetion http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – jpic 2012-05-20 22:04:04

相關問題