美文网首页
django-xadmin 初见 python3

django-xadmin 初见 python3

作者: Royalknight | 来源:发表于2017-06-19 14:48 被阅读0次

今天尝试搭建xadmin来试一试,


首先先安装xadmin

pip install django-xadmin
然鹅,我们发现

Collecting django-xadmin
  Using cached django-xadmin-0.5.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\zpc\AppData\Local\Temp\pip-build-spx7k943\django-xadmin\setup.py", line 11, in <module>
        long_description=open('README.rst').read(),
    UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4 in position 3256: illegal multibyte sequence

哈哈 这种情况, 我选择放弃,


  • 不 我怎么能放弃,我可是社会主义接班人,不能碰到点 困难就放弃,
  • 不如我们换个角度采用非常规方法来处理
  • 我们发现是README.ret 这个文件编码有问题,我们就把源码包下载下来,改下那个文件, 在本地编译,
  • README.ret 一看也不是重要的文件
  • 开始搞 https://github.com/sshwsfc/xadmin 下载地址
  • 下载之后 解压开, 替换一个空的README.ret 进去, 直接pip install 这个 zip压缩包
C:\Users\zpc\Desktop>pip install xadmin-master.zip
Requirement 'xadmin-master.zip' looks like a filename, but the file does not exist
Processing c:\users\zpc\desktop\xadmin-master.zip
Exception:
Traceback (most recent call last):
  File "c:\users\zpc\appdata\local\programs\python\python35-32\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\users\zpc\appdata\local\programs\python\python35-32\lib\site-packages\pip\commands\install.py", line 335, in run
    wb.build(autobuilding=True)
  File "c:\users\zpc\appdata\local\programs\python\python35-32\lib\site-packages\pip\wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "c:\users\zpc\appdata\local\programs\python\python35-32\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "c:\users\zpc\appdata\local\programs\python\python35-32\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "c:\users\zpc\appdata\local\programs\python\python35-32\lib\site-packages\pip\download.py", line 809, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "c:\users\zpc\appdata\local\programs\python\python35-32\lib\site-packages\pip\download.py", line 715, in unpack_file_url
    unpack_file(from_path, location, content_type, link)
  File "c:\users\zpc\appdata\local\programs\python\python35-32\lib\site-packages\pip\utils\__init__.py", line 599, in unpack_file
    flatten=not filename.endswith('.whl')
  File "c:\users\zpc\appdata\local\programs\python\python35-32\lib\site-packages\pip\utils\__init__.py", line 482, in unzip_file
    zipfp = open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\zpc\\Desktop\\xadmin-master.zip'

一大堆错误

哈哈哈哈哈 我再次选择放弃


不行 我不能 被这一点点困难击倒
我们在换个角度来处理, 既然这么多问题, 我们就去 她的git查看一下

QQ截图20170619151958.png
显示的支持python3,那可能就是我们安装方法有问题了,继续往下翻看看, git上让我们怎么安装
QQ截图20170619152054.png
找到了在这里, 第一个方法 我们试过了, 不行 编码报错,我们来使用第二种方法
pip install git+git://github.com/sshwsfc/xadmin.git

等了大半天

D:\>pip install git+git://github.com/sshwsfc/xadmin.git
Collecting git+git://github.com/sshwsfc/xadmin.git
  Cloning git://github.com/sshwsfc/xadmin.git to c:\users\zpc\appdata\local\temp\pip-9spp752s-build
Requirement already satisfied: setuptools in c:\users\zpc\appdata\local\programs\python\python35-32\lib\site-packages (from xadmin==0.6.1)
Requirement already satisfied: django<2,>=1.9.0 in c:\users\zpc\appdata\local\programs\python\python35-32\lib\site-packages (from xadmin==0.6.1)
Collecting django-crispy-forms>=1.6.0 (from xadmin==0.6.1)
  Downloading django_crispy_forms-1.6.1-py2.py3-none-any.whl (103kB)
    100% |████████████████████████████████| 112kB 15kB/s
Collecting django-reversion>=2.0.0 (from xadmin==0.6.1)
  Downloading django_reversion-2.0.8-py2.py3-none-any.whl (80kB)
    100% |████████████████████████████████| 81kB 12kB/s
Collecting django-formtools>=1.0 (from xadmin==0.6.1)
  Downloading django_formtools-2.0-py2.py3-none-any.whl (131kB)
    69% |██████████████████████▍         | 92kB 9.1kB/s eta 0:00:05
socket.timeout: The read operation timed out

下载超时

哈哈哈哈哈哈哈

15EFFB77.jpg

不行都到这一步了, 都到这里了,
怎么能轻言放弃,不,
继续下载,终于 花了一下午的时间,我装上了,

Successfully installed django-crispy-forms-1.6.1 django-formtools-2.0 django-reversion-2.0.8 future-0.16.0 httplib2-0.9.2 xadmin-0.6.1

哈哈哈哈哈

我选择

PNPUT~WJJ4W_SW3VI4B${C.jpg

相关文章

网友评论

      本文标题:django-xadmin 初见 python3

      本文链接:https://www.haomeiwen.com/subject/dgigqxtx.html