卡在这个xadmin的安装这里了,按照视频的步骤重新做了安装还是不行报错

卡在这个xadmin的安装这里了,按照视频的步骤重新做了安装还是不行报错

尝试了自动安装了网上的源码安装都不行,有没有具体的步骤


Microsoft Windows [版本 10.0.18363.720]

                                                  H:\py_learn_1\django_mall>

H:\py_learn_1\django_mall>python manage.py makemigrations

Traceback (most recent call last):

  File "manage.py", line 22, in <module>

    execute_from_command_line(sys.argv)

  File "F:\Python\lib\site-packages\django\core\management\__init__.py", line 364, in execute_from_command_line

    utility.execute()

  File "F:\Python\lib\site-packages\django\core\management\__init__.py", line 338, in execute

    django.setup()

  File "F:\Python\lib\site-packages\django\__init__.py", line 27, in setup

    apps.populate(settings.INSTALLED_APPS)

  File "F:\Python\lib\site-packages\django\apps\registry.py", line 85, in populate

    app_config = AppConfig.create(entry)

  File "F:\Python\lib\site-packages\django\apps\config.py", line 94, in create

    module = import_module(entry)

  File "F:\Python\lib\importlib\__init__.py", line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 728, in exec_module

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

  File "H:\py_learn_1\django_mall\extra_apps\xadmin\__init__.py", line 4, in <module>

    from xadmin.sites import AdminSite, site

  File "H:\py_learn_1\django_mall\extra_apps\xadmin\sites.py", line 3, in <module>

    from future.utils import iteritems

ModuleNotFoundError: No module named 'future'


H:\py_learn_1\django_mall>pip install python-future

ERROR: Could not find a version that satisfies the requirement python-future (from versions: none)

ERROR: No matching distribution found for python-future


H:\py_learn_1\django_mall>pip install django-import-export

Collecting django-import-export

  Downloading django_import_export-2.0.2-py3-none-any.whl (82 kB)

     |████████████████████████████████| 82 kB 11 kB/s

Collecting tablib[html,ods,xls,xlsx,yaml]>=0.14.0

  Downloading tablib-1.1.0-py3-none-any.whl (47 kB)

     |████████████████████████████████| 47 kB 10 kB/s

Collecting diff-match-patch

  Downloading diff-match-patch-20181111.tar.gz (58 kB)

     |████████████████████████████████| 58 kB 6.1 kB/s

Collecting Django>=2.0

  Downloading Django-3.0.4-py3-none-any.whl (7.5 MB)

     |████                            | 901 kB 4.1 kB/s eta 0:26:47ERROR: Exception:

Traceback (most recent call last):

  File "f:\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 425, in _error_catcher

    yield

  File "f:\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 507, in read

    data = self._fp.read(amt) if not fp_closed else b""

  File "f:\python\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read

    data = self.__fp.read(amt)

  File "f:\python\lib\http\client.py", line 447, in read

    n = self.readinto(b)

  File "f:\python\lib\http\client.py", line 491, in readinto

    n = self.fp.readinto(b)

  File "f:\python\lib\socket.py", line 589, in readinto

    return self._sock.recv_into(b)

  File "f:\python\lib\ssl.py", line 1052, in recv_into

    return self.read(nbytes, buffer)

  File "f:\python\lib\ssl.py", line 911, in read

    return self._sslobj.read(len, buffer)

socket.timeout: The read operation timed out


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "f:\python\lib\site-packages\pip\_internal\cli\base_command.py", line 186, in _main

    status = self.run(options, args)

  File "f:\python\lib\site-packages\pip\_internal\commands\install.py", line 331, in run

    resolver.resolve(requirement_set)

  File "f:\python\lib\site-packages\pip\_internal\legacy_resolve.py", line 177, in resolve

    discovered_reqs.extend(self._resolve_one(requirement_set, req))

  File "f:\python\lib\site-packages\pip\_internal\legacy_resolve.py", line 333, in _resolve_one

    abstract_dist = self._get_abstract_dist_for(req_to_install)

  File "f:\python\lib\site-packages\pip\_internal\legacy_resolve.py", line 282, in _get_abstract_dist_for

    abstract_dist = self.preparer.prepare_linked_requirement(req)

  File "f:\python\lib\site-packages\pip\_internal\operations\prepare.py", line 482, in prepare_linked_requirement

    hashes=hashes,

  File "f:\python\lib\site-packages\pip\_internal\operations\prepare.py", line 287, in unpack_url

    hashes=hashes,

  File "f:\python\lib\site-packages\pip\_internal\operations\prepare.py", line 159, in unpack_http_url

    link, downloader, temp_dir.path, hashes

  File "f:\python\lib\site-packages\pip\_internal\operations\prepare.py", line 303, in _download_http_url

    for chunk in download.chunks:

  File "f:\python\lib\site-packages\pip\_internal\utils\ui.py", line 160, in iter

    for x in it:

  File "f:\python\lib\site-packages\pip\_internal\network\utils.py", line 39, in response_chunks

    decode_content=False,

  File "f:\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 564, in stream

    data = self.read(amt=amt, decode_content=decode_content)

  File "f:\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 529, in read

    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)

  File "f:\python\lib\contextlib.py", line 130, in __exit__

    self.gen.throw(type, value, traceback)

  File "f:\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 430, in _error_catcher

    raise ReadTimeoutError(self._pool, None, "Read timed out.")

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.


H:\py_learn_1\django_mall>


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕美 2020-03-22 17:24:08

同学,你好。使用源码安装xadmin后,还会需要安装一些第三方模块,同学根据报错提示缺少哪个模块安装哪个即可

1、同学使用pip install future安装future模块即可

2、在安装django-import-export时报错为超时错误,可能是由于网络原因导致的,同学可以切换国内源下载或在网络较好时重新下载即可。

例:pip install xxx -i xxxxxxxxxxxxxxxxxxx

清华:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/ 

豆瓣:http://pypi.douban.com/simple/

如果我的回答解决了您的疑惑,请采纳!祝学习愉快~~~~

  • 提问者 慕粉232102761 #1
    安装了一个圈后又回到了这个错误,命名提示已经安装成功,然后生成python manage.py makemigrations同步原语时又报错ImportError: cannot import name 'six' from 'django.utils' 求指导 from django.utils import six ImportError: cannot import name 'six' from 'django.utils' (C:\Users\Administrator\Envs\django1.11\lib\site-packages\django\utils\__init__.py)
    2020-03-23 21:35:37
  • 好帮手慕美 回复 提问者 慕粉232102761 #2
    同学,你好。同学可以看下当前环境中使用的是哪个版本的django,在django 3.x 系列删除了six。同学可以安装1.11.18版本的django,或者使用pip install six安装该模块,并将six.py拷贝进django/utils/目录下。祝学习愉快~~~~
    2020-03-24 10:42:34
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
3.从网页搭建入门Python Web
  • 参与学习           人
  • 提交作业       218    份
  • 解答问题       3562    个

本阶段带你用Python开发一个网站,学习主流框架Django+Flask是Python Web开发的第一步,在基础知识上实现积分商城的项目开发,体验真实的项目开发流程,提高解决编程问题和效率的能力。

了解课程
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师