Reputation: 795
i'm trying to deploy a django project on Heroku. I use virtualenv and pip to manage dependencies. The virtualenv version is 1.7.1 and pip that comes with it it's 1.1. I tried to force the --no-site-packages but it prompts that it's the default behavior now. Also i'm sure that i install everything within the virtual environment. The django project it's empty. I followed the instructions here . Maybe the problem it's that their versions of pip and virtualenv are older? Has anyone encountered this problem? Thank you in advance.
ψ 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
Upvotes: 2
Views: 1077
Reputation: 795
It seems that the problem it is in the requirements.txt, i created it using powershell and "pip.exe freeze > requirements.txt" command, which creates a file with a name that has nullbytes in it. I was able to get around this problem by downloading a requirements.txt from an example project on github and modifying it. That did the job and everything works nice.
Upvotes: 7