zhuyingchao 发表于 2021-1-5 17:27:35

windows10 安装openyxl报错

python版本是3.8.3,安装openyxl的时候报如下错误,是什么原因呀?

D:\Users\zhuyingchao\openpyxl-3.0.5>python setup.py install
running install
running bdist_egg
running egg_info
writing openpyxl.egg-info\PKG-INFO
writing dependency_links to openpyxl.egg-info\dependency_links.txt
writing requirements to openpyxl.egg-info\requires.txt
writing top-level names to openpyxl.egg-info\top_level.txt
reading manifest file 'openpyxl.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'openpyxl\sample'
no previously-included directories found matching 'openpyxl\benchmarks'
no previously-included directories found matching 'openpyxl\develop'
no previously-included directories found matching 'scratchpad'
no previously-included directories found matching 'doc'
writing manifest file 'openpyxl.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
copying openpyxl.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying openpyxl.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying openpyxl.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying openpyxl.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying openpyxl.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist\openpyxl-3.0.5-py3.8.egg' and adding 'build\bdist.win-amd64\egg' to it
Traceback (most recent call last):
File "setup.py", line 62, in <module>
    setup(
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\install.py", line 67, in run
    self.do_egg_install()
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\bdist_egg.py", line 233, in run
    make_zipfile(self.egg_output, archive_root, verbose=self.verbose,
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\bdist_egg.py", line 497, in make_zipfile
    visit(z, dirname, files)
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\bdist_egg.py", line 490, in visit
    z.write(path, p)
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\zipfile.py", line 1740, in write
    zinfo = ZipInfo.from_file(filename, arcname,
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\zipfile.py", line 538, in from_file
    zinfo = cls(arcname, date_time)
File "C:\Users\zhuyingchao\AppData\Local\Programs\Python\Python38\lib\zipfile.py", line 361, in __init__
    raise ValueError('ZIP does not support timestamps before 1980')
ValueError: ZIP does not support timestamps before 1980

D:\Users\zhuyingchao\openpyxl-3.0.5>date
当前日期: 2021/01/05 周二

hrp 发表于 2021-1-5 17:30:23

ZIP不支持1980年以前的时间戳

zhuyingchao 发表于 2021-1-5 17:31:43

没找到哪里有1980以前的时间戳,这个应该怎么解决呢

hrp 发表于 2021-1-5 18:20:15

zhuyingchao 发表于 2021-1-5 17:31
没找到哪里有1980以前的时间戳,这个应该怎么解决呢

安装包的问题,直接pip install openpyxl就可以了,没必要从文件安装

zhuyingchao 发表于 2021-1-5 18:27:43

嗯,pip安装可以{:10_332:}
页: [1]
查看完整版本: windows10 安装openyxl报错