我正在尝试安装django文件选择器,但无论出于何种原因,似乎setup.py存在问题。我不熟悉设置如何工作,所以它可能很容易修复,但我不知道。堆栈跟踪如下。
我在Windows上使用python 2.7.2在virtualenv中执行此操作。
从解压缩包中:
>python ./setup.py install
running install
running bdist_egg
running egg_info
creating django_file_picker.egg-info
writing requirements to django_file_picker.egg-info\requires.txt
writing django_file_picker.egg-info\PKG-INFO
writing top-level names to django_file_picker.egg-info\top_level.txt
writing dependency_links to django_file_picker.egg-info\dependency_links.txt
writing manifest file 'django_file_picker.egg-info\SOURCES.txt'
reading manifest file 'django_file_picker.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
Traceback (most recent call last):
File "./setup.py", line 25, in <module>
zip_safe=False, # because we're including media that Django needs
File "C:\Python27\Lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\install.py", line 76, in run
self.do_egg_install()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\install.py", line 96, in do_egg_install
self.run_command('bdist_egg')
File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\bdist_egg.py", line 167, in run
self.run_command("egg_info")
File "C:\Python27\Lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\egg_info.py", line 177, in run
self.find_sources()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\egg_info.py", line 252, in find_sources
mm.run()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\egg_info.py", line 308, in run
self.read_template()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\sdist.py", line 162, in read_template
sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close()
File "C:\Python27\Lib\distutils\text_file.py", line 128, in close
self.file.close ()
AttributeError: 'NoneType' object has no attribute 'close'
从下载的软件包外部:
>pip install ./caktus-django-file-picker-c1d628d
Unpacking c:\users\marcin\documents\oneclickcos\caktus-django-file-picker-c1d628d
Running setup.py egg_info for package from file:///c%7C%5Cusers%5Cmarcin%5Cdocuments%5Coneclickcos%5Ccaktus-django-file-picker-c1d
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "c:\users\marcin\appdata\local\temp\pip-2kgmcr-build\setup.py", line 25, in <module>
zip_safe=False, # because we're including media that Django needs
File "C:\Python27\Lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "<string>", line 12, in replacement_run
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\egg_info.py", line 252, in find_sources
mm.run()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\egg_info.py", line 308, in run
self.read_template()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\sdist.py", line 162, in read_template
sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close()
File "C:\Python27\Lib\distutils\text_file.py", line 128, in close
self.file.close ()
AttributeError: 'NoneType' object has no attribute 'close'
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info\django_file_picker.egg-info
writing requirements to pip-egg-info\django_file_picker.egg-info\requires.txt
writing pip-egg-info\django_file_picker.egg-info\PKG-INFO
writing top-level names to pip-egg-info\django_file_picker.egg-info\top_level.txt
writing dependency_links to pip-egg-info\django_file_picker.egg-info\dependency_links.txt
writing manifest file 'pip-egg-info\django_file_picker.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'pip-egg-info\django_file_picker.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "c:\users\marcin\appdata\local\temp\pip-2kgmcr-build\setup.py", line 25, in <module>
zip_safe=False, # because we're including media that Django needs
File "C:\Python27\Lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "<string>", line 12, in replacement_run
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\egg_info.py", line 252, in find_sources
mm.run()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\egg_info.py", line 308, in run
self.read_template()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\sdist.py", line 162, in read_template
sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close()
File "C:\Python27\Lib\distutils\text_file.py", line 128, in close
self.file.close ()
AttributeError: 'NoneType' object has no attribute 'close'
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in C:\Users\Marcin\AppData\Roaming\pip\pip.log
(oneclickcos) C:\Users\Marcin\Documents\oneclickcos>python caktus-django-file-picker-c1d628d\setup.py
Traceback (most recent call last):
File "caktus-django-file-picker-c1d628d\setup.py", line 23, in <module>
long_description=open('README.rst').read(),
IOError: [Errno 2] No such file or directory: 'README.rst'
来自pypi:
>pip install django-file-picker
Running setup.py egg_info for package django-file-picker
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "C:\Users\Marcin\Documents\oneclickcos\build\django-file-picker\setup.py", line 25, in <module>
zip_safe=False, # because we're including media that Django needs
File "C:\Python27\Lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "<string>", line 12, in replacement_run
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\egg_info.py", line 252, in find_sources
mm.run()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\egg_info.py", line 308, in run
self.read_template()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\sdist.py", line 162, in read_template
sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close()
File "C:\Python27\Lib\distutils\text_file.py", line 128, in close
self.file.close ()
AttributeError: 'NoneType' object has no attribute 'close'
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info\django_file_picker.egg-info
writing requirements to pip-egg-info\django_file_picker.egg-info\requires.txt
writing pip-egg-info\django_file_picker.egg-info\PKG-INFO
writing top-level names to pip-egg-info\django_file_picker.egg-info\top_level.txt
writing dependency_links to pip-egg-info\django_file_picker.egg-info\dependency_links.txt
writing manifest file 'pip-egg-info\django_file_picker.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'pip-egg-info\django_file_picker.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "C:\Users\Marcin\Documents\oneclickcos\build\django-file-picker\setup.py", line 25, in <module>
zip_safe=False, # because we're including media that Django needs
File "C:\Python27\Lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\Lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\Lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "<string>", line 12, in replacement_run
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\egg_info.py", line 252, in find_sources
mm.run()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\egg_info.py", line 308, in run
self.read_template()
File "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\setuptools\command\sdist.py", line 162, in read_template
sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close()
File "C:\Python27\Lib\distutils\text_file.py", line 128, in close
self.file.close ()
AttributeError: 'NoneType' object has no attribute 'close'
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in C:\Users\Marcin\AppData\Roaming\pip\pip.log
答案 0 :(得分:3)
我遇到了同样的错误,在我的情况下,它是由我的MANIFEST.in文件中的一个路径中的尾部斜杠引起的。
由于一些奇怪的原因,这会导致崩溃。而不是
recursive-include foo/bar/
使用
recursive-include foo/bar
同样适用于移植,修剪等。