无法使用pipenv install安装django项目依赖项

发布于 2025-01-10 09:46:39 字数 3565 浏览 2 评论 0原文

我想在新的 ubuntu 20.04 中安装 Django 项目。 该项目需要python3.9,所以我使用sudo apt install python3.9 python3-pip安装了python3.9,然后使用pip安装了django。

现在我想使用 pipenv install 安装项目依赖项,

这是我得到的错误:

mahdi@mahdi-Latitude-E6430:~/Desktop/Project1$ pipenv install
Creating a virtualenv for this project…
Using /usr/bin/python3.9 (3.9.5) to create virtualenv…
⠋created virtual environment CPython3.9.5.final.0-64 in 429ms
  creator CPython3Posix(dest=/home/mahdi/.local/share/virtualenvs/Project1-UUOFIsQX, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/mahdi/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

Virtualenv location: /home/mahdi/.local/share/virtualenvs/Project1-UUOFIsQX
Pipfile.lock (6ab9a1) out of date, updating to (5b3760)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
1]
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/resolver.py", line 72, in resolve_hashes
    return {ireq: self.repository.get_hashes(ireq) for ireq in ireqs}
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/resolver.py", line 72, in <dictcomp>
    return {ireq: self.repository.get_hashes(ireq) for ireq in ireqs}
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 274, in get_hashes
    return {
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 275, in <setcomp>
    self._get_file_hash(candidate.location)
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 282, in _get_file_hash
    for chunk in iter(lambda: fp.read(8096), b""):
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 282, in <lambda>
    for chunk in iter(lambda: fp.read(8096), b""):
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/_vendor/requests/packages/urllib3/response.py", line 324, in read
    flush_decoder = True
  File "/usr/lib/python3.9/contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/_vendor/requests/packages/urllib3/response.py", line 237, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip9._vendor.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

Pipfile

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
asgiref = "==3.4.1"
psycopg2 = "==2.9.1"
pytz = "==2021.1"
sqlparse = "==0.4.2"
django-extensions = "==3.1.3"
Django = "==3.2.11"
Pillow = "==9.0.0"
pandas = "==1.3.2"
openpyxl = "==3.0.7"
factory-boy = "==3.2.0"
py-avataaars = "==1.1.2"
gunicorn = "==20.1.0"
django-heroku = "==0.3.1"
whitenoise = "==5.3.0"
django-webpack-loader = "==1.3.0"
et-xmlfile = "==1.1.0"
faker = "==8.12.0"
numpy = "==1.21.2"
python-dateutil = "==2.8.2"
six = "==1.16.0"
text-unidecode = "==1.3"
django-modeltranslation = "==0.17.3"
python-dotenv = "==0.19.2"
django-cors-headers = "==3.11.0"
django-hijack = "==3.1.4"
django-admin-honeypot = "==1.1.0"
django-axes = "==5.31.0"
xlsxwriter = "==3.0.2"

[dev-packages]
flake8 = "==4.0.1"

[requires]
python_version = "3.9"

我已经尝试了很多可能的方法,但找不到任何解决方案。

I want to install Django project in fresh ubuntu 20.04.
The project requires python3.9, so I installed python3.9 using sudo apt install python3.9 python3-pip then I installed django using pip.

Now I want to install the project dependencies using pipenv install

here is the error I get:

mahdi@mahdi-Latitude-E6430:~/Desktop/Project1$ pipenv install
Creating a virtualenv for this project…
Using /usr/bin/python3.9 (3.9.5) to create virtualenv…
⠋created virtual environment CPython3.9.5.final.0-64 in 429ms
  creator CPython3Posix(dest=/home/mahdi/.local/share/virtualenvs/Project1-UUOFIsQX, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/mahdi/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

Virtualenv location: /home/mahdi/.local/share/virtualenvs/Project1-UUOFIsQX
Pipfile.lock (6ab9a1) out of date, updating to (5b3760)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
1]
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/resolver.py", line 72, in resolve_hashes
    return {ireq: self.repository.get_hashes(ireq) for ireq in ireqs}
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/resolver.py", line 72, in <dictcomp>
    return {ireq: self.repository.get_hashes(ireq) for ireq in ireqs}
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 274, in get_hashes
    return {
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 275, in <setcomp>
    self._get_file_hash(candidate.location)
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 282, in _get_file_hash
    for chunk in iter(lambda: fp.read(8096), b""):
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 282, in <lambda>
    for chunk in iter(lambda: fp.read(8096), b""):
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/_vendor/requests/packages/urllib3/response.py", line 324, in read
    flush_decoder = True
  File "/usr/lib/python3.9/contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/_vendor/requests/packages/urllib3/response.py", line 237, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip9._vendor.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

Pipfile

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
asgiref = "==3.4.1"
psycopg2 = "==2.9.1"
pytz = "==2021.1"
sqlparse = "==0.4.2"
django-extensions = "==3.1.3"
Django = "==3.2.11"
Pillow = "==9.0.0"
pandas = "==1.3.2"
openpyxl = "==3.0.7"
factory-boy = "==3.2.0"
py-avataaars = "==1.1.2"
gunicorn = "==20.1.0"
django-heroku = "==0.3.1"
whitenoise = "==5.3.0"
django-webpack-loader = "==1.3.0"
et-xmlfile = "==1.1.0"
faker = "==8.12.0"
numpy = "==1.21.2"
python-dateutil = "==2.8.2"
six = "==1.16.0"
text-unidecode = "==1.3"
django-modeltranslation = "==0.17.3"
python-dotenv = "==0.19.2"
django-cors-headers = "==3.11.0"
django-hijack = "==3.1.4"
django-admin-honeypot = "==1.1.0"
django-axes = "==5.31.0"
xlsxwriter = "==3.0.2"

[dev-packages]
flake8 = "==4.0.1"

[requires]
python_version = "3.9"

I have tried a lot of possible way, but could'nt find any solutions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文