[英]Invalid symlink "venv/bin/python3"
I'm trying to upload my Django code to Heroku but I am getting a build error:我正在尝试将我的 Django 代码上传到 Heroku 但出现构建错误:
=== Fetching app code failed.
=!= Invalid symlink "venv/bin/python3". Cannot point outside the working directory
My Pipfile
is我的
Pipfile
是
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
django = "~=3.1.0"
whitenoise = "==5.1.0"
gunicorn = "==19.9.0"
psycopg2-binary = "==2.8.5"
pillow = "==7.2.0"
django-debug-toolbar = "==2.2"
environs = {version = "==8.0.0", extras = ["django"]}
django-storages = "*"
boto3 = "*"
[requires]
python_version = "3.8"
Is anyone able to help me please?有人可以帮助我吗?
It looks like you have a virtual environment in a venv/
subdirectory.看起来您在
venv/
子目录中有一个虚拟环境。 This directory should not be pushed to Heroku (or committed at all).此目录不应推送到 Heroku(或根本不提交)。
Remove it from your repository, eg by doing something like从您的存储库中删除它,例如通过执行类似的操作
git rm -r --cached venv
git commit -m "Untrack virtual environment"
Then commit and push to GitHub or Heroku again, depending how you are deploying.然后再次提交并推送到 GitHub 或 Heroku,具体取决于您的部署方式。
I recently encountered this error.我最近遇到了这个错误。 Just search for any symlinks anywhere in the project directory and try to remove them (since they may be pointing to some place on local)
只需在项目目录中的任何位置搜索任何符号链接并尝试删除它们(因为它们可能指向本地的某个地方)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.