我该如何解决这个 pipenv 安装错误 - vscode 上的 django 项目
Posted
技术标签:
【中文标题】我该如何解决这个 pipenv 安装错误 - vscode 上的 django 项目【英文标题】:how can i solve this pipenv install error - django project on vscode 【发布时间】:2022-01-04 05:17:30 【问题描述】:我正在尝试通过学习 Mosh 的课程来创建一个具有登录、CRUD 等功能的平台网站,但我被困在 [Django 课程的第 1 部分 -> Django ORM -> 3-重置数据库]
在这个类中,Mosh 想要确保我们在同一页面上,所以他告诉我们将一个特定文件夹(包含 django 项目)拖放到 VSCode 中,他在当然。
我遵循了所有步骤,但是,一旦我尝试在终端上运行“pipenv install”(正如他在删除该文件夹后告诉我们的那样),我收到以下错误消息:
Installing dependencies from Pipfile.lock (f41128)...
An error occurred while installing asgiref==3.3.4; python_version >= '3.6' --hash=sha256:d1216dfbdfb63826470995d31caed36225dcaf34f182e0fa257a4dd9e86f1b78 --hash=sha256:92906c611ce6c967347bbfea733f13d6313901d54dcca88195eaeb52b2a8e8ee! Will try again.
An error occurred while installing django==3.2.4 --hash=sha256:66c9d8db8cc6fe938a28b7887c1596e42d522e27618562517cc8929eb7e7f296 --hash=sha256:ea735cbbbb3b2fba6d4da4784a0043d84c67c92f1fdf15ad6db69900e792c10f! Will try again.
An error occurred while installing django-debug-toolbar==3.2.1 --hash=sha256:e759e63e3fe2d3110e0e519639c166816368701eab4a47fed75d7de7018467b9 --hash=sha256:a5ff2a54f24bf88286f9872836081078f4baa843dc3735ee88524e89f8821e33! Will try again.
An error occurred while installing mysqlclient==2.0.3 --hash=sha256:71c4b330cf2313bbda0307fc858cc9055e64493ba9bf28454d25cf8b3ee8d7f5 --hash=sha256:f6ebea7c008f155baeefe16c56cd3ee6239f7a5a9ae42396c2f1860f08a7c432 --hash=sha256:fc575093cf81b6605bed84653e48b277318b880dc9becf42dd47fa11ffd3e2b6 --hash=sha256:3381ca1a4f37ff1155fcfde20836b46416d66531add8843f6aa6d968982731c3 --hash=sha256:0ac0dd759c4ca02c35a9fedc24bc982cf75171651e8187c2495ec957a87dfff7! Will try again.
An error occurred while installing pytz==2021.1 --hash=sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798 --hash=sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da! Will try again.
An error occurred while installing sqlparse==0.4.1; python_version >= '3.5' --hash=sha256:0f91fd2e829c44362cbcfab3e9ae12e22badaa8a29ad5ff599f9ec109f0454e8 --hash=sha256:017cde379adbd6a1f15a61873f43e8274179378e95ef3fede90b5aa64d304ed0! Will try again.
???? ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 6/6 — 00:00:03
Installing initially failed dependencies...
[pipenv.exceptions.InstallError]: Collecting asgiref==3.3.4
[pipenv.exceptions.InstallError]: Using cached asgiref-3.3.4-py3-none-any.whl (22 kB)
[pipenv.exceptions.InstallError]: Installing collected packages: asgiref
[pipenv.exceptions.InstallError]: ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/Users/jart/.local/share/virtualenvs/storefront-i8ah_EvC/lib/python3.9/site-packages/asgiref'
[pipenv.exceptions.InstallError]: Check the permissions.
ERROR: Couldn't install package: asgiref
Package installation failed...
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 56425 is still running
_warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.FileIO name=14 mode='rb' closefd=True>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.FileIO name=17 mode='rb' closefd=True>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
☤ ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 5/6 — 00:00:04
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 56421 is still running
_warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=5 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=8 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 56422 is still running
_warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=7 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=10 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 56423 is still running
_warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=9 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=13 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 56424 is still running
_warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=11 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=15 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
那么,它可能是什么,我该如何解决?
我尝试用谷歌搜索 - 没有成功。 我正在使用 python 3.10 并且还尝试使用与 Mosh (3.9.5) 相同的版本,但这也不起作用。 老实说,我不知道该怎么办了。
【问题讨论】:
这能回答你的问题吗? pip install failing with: OSError: [Errno 13] Permission denied on directory 【参考方案1】:你试过在外部安装 pipenv 吗?
下面的链接会帮助你。
我个人的建议是,如果你打算使用 python & django 或者它们的任何框架或库,你应该选择 linux 或 mac os 作为操作系统。在 Windows 中,某些地方可能会出现烦人的问题。
此链接将对您有所帮助。
https://pipenv.pypa.io/en/latest/install/
【讨论】:
您好,谢谢您的回复!我很抱歉我的无知,但是你在外部安装 pipenv 是什么意思?我正在使用 macOS Big Sur v11.4。以上是关于我该如何解决这个 pipenv 安装错误 - vscode 上的 django 项目的主要内容,如果未能解决你的问题,请参考以下文章
我已经在我的本地系统上安装了 Magento2,它给了我以下错误通知作为“PHP Extension xsl”。我该如何解决这个问题
markdown 如何在Win10上设置pipenv与VS Code一起使用