离线安装django-axes
如果在线安装, pip install django-axes,很容易
但在内⽹环境,没那么容易,
根据以前的经验,下载 安装
但这次,⽤上⾯⽅法不⾏,因为axes这个包,还有关联的其他app,离线安装时,内部默认联⽹下载其他包,所以失败。失败信息如下:
这次,我在可以上⽹的电脑上,把相关包下载下来
pip download django-axes -d ./aaa
(py3.6env) lxg@lxg-opt:~/98receive/pystudy/general1$ pip download django-axes -d ./aaa
Collecting django-axes
Downloading django_axes-5.20.0-py3-none-any.whl (53 kB)
|████████████████████████████████| 53 kB 102 kB/s
Saved ./aaa/django_axes-5.20.0-py3-none-any.whl
Collecting django>=2.2
Using cached Django-3.2.4-py3-none-any.whl (7.9 MB)
Saved ./aaa/Django-3.2.4-py3-none-any.whl
Collecting django-ipware<4,>=3
Using cached django-ipware-3.0. (9.0 kB)
Saved ./aaa/django-ipware-3.0.
Collecting asgiref<4,>=3.3.2
下载结果:
然后复制到内⽹机器
⼀点⼀点安装,先安装相关依赖,最后安装 django-axes,最后居然成功了
(py368) [root@localhost emic]# pip install asgiref-3.3.4-py3-none-any.whl
Processing ./asgiref-3.3.4-py3-none-any.whl
Requirement already satisfied: typing-extensions; python_version < "3.8"in /data/env/py368/lib/python3.6/site-packages (from asgiref==3.3.4) (3.7.4.1)
Installing collected packages: asgiref
Successfully installed asgiref-3.3.4
(py368) [root@localhost emic]#
(py368) [root@localhost emic]# pip install pytz-2021.1-py2.py3-none-any.whl
Processing ./pytz-2021.1-py2.py3-none-any.whl
ERROR: django-stubs 1.5.0 has requirement mypy<0.780,>=0.770, but you'll have mypy 0.720 which is incompatible.
Installing collected packages: pytz
Attempting uninstall: pytz
Found existing installation: pytz 2019.1
Uninstalling pytz-2019.1:
Successfully uninstalled pytz-2019.1
Successfully installed pytz-2021.1
(py368) [root@localhost emic]#
(py368) [root@localhost emic]# pip install typing_extensions-3.10.0.0-py3-none-any.whl
Processing ./typing_extensions-3.10.0.0-py3-none-any.whl
ERROR: django-stubs 1.5.0 has requirement mypy<0.780,>=0.770, but you'll have mypy 0.720 which is incompatible.
Installing collected packages: typing-extensions
Attempting uninstall: typing-extensions
Found existing installation: typing-extensions 3.7.4.1
Uninstalling typing-extensions-3.7.4.1:
Successfully uninstalled typing-extensions-3.7.4.1
Successfully installed typing-extensions-3.10.0.0
(py368) [root@localhost emic]# pip install sqlparse-0.4.1-py3-none-any.whl
Processing ./sqlparse-0.4.1-py3-none-any.whl
ERROR: django-stubs 1.5.0 has requirement mypy<0.780,>=0.770, but you'll have mypy 0.720 which is incompatible.
Installing collected packages: sqlparse
Attempting uninstall: sqlparse
Found existing installation: sqlparse 0.3.0
Uninstalling sqlparse-0.3.0:
Successfully uninstalled sqlparse-0.3.0
Successfully installed sqlparse-0.4.1
(py368) [root@localhost emic]# pip install django-ipware-3.0.
Processing ./django-ipware-3.0.
django登录注册功能Building wheels for collected packages: django-ipware
Building wheel for django-ipware (setup.py) ... done
Created wheel for django-ipware: filename=django_ipware-3.0.2-py2.py3-none-any.whl size=9336 sha256=ea737403b4fb9c7875699b7634e0346625bb803184717c948f8c04c0fe8c601a
Stored in directory: /root/.cache/pip/wheels/70/1b/c0/7ade9431c50d055ea10142a8cff941b3840df353b7eaa6dd93
Successfully built django-ipware
Installing collected packages: django-ipware
Successfully installed django-ipware-3.0.2
(py368) [root@localhost emic]# pip install django-axes-5.19.0 注意,这样直接安装注定失败,因为⾛互联⽹
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._tion.VerifiedHTTPSConnection object at 0x7fbe840fe400>: Failed to estab ^Z
[6]+  Stopped                pip install django-axes-5.19.0
(py368) [root@localhost emic]# pip install django_axes-5.19.0-py3-none-any.whl  这个是成功的,这个是⽤下载的⽂件
Processing ./django_axes-5.19.0-py3-none-any.whl
Requirement already satisfied: django>=2.2in /data/env/py368/lib/python3.6/site-packages (from django-axes==5.19.0) (2.2.2)
Requirement already satisfied: django-ipware<4,>=3in /data/env/py368/lib/python3.6/site-packages (from django-axes==5.19.0) (3.0.2)
Requirement already satisfied: sqlparse in /data/env/py368/lib/python3.6/site-packages (from django>=2.2->django-axes==5.19.0) (0.4.1)
Requirement already satisfied: pytz in /data/env/py368/lib/python3.6/site-packages (from django>=2.2->django-axes==5.19.0) (2021.1)
Installing collected packages: django-axes
Successfully installed django-axes-5.19.0看到成功信息,很开⼼

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。