尝试:
您将在site packages目录中找到模板,其中包含文件名
script (dev).tmpl
以下内容:
$ cat ".venv/lib/python3.6/site-packages/setuptools/script (dev).tmpl"
__requires__ = %(spec)r
__import__('pkg_resources').require(%(spec)r)
__file__ = %(dev_path)r
exec(compile(open(__file__).read(), __file__, 'exec'))
根据需要编辑,例如:
__requires__ = %(spec)r
__import__('pkg_resources').require(%(spec)r)
__file__ = %(dev_path)r
try:
f = open(__file__)
exec(compile(f.read(), __file__, 'exec'))
finally:
f.close()
最后:
投票请求:
https://github.com/pypa/setuptools/pull/1398
这几乎是立即合并的,因此模板应该在下一个SETUPTOOLS版本中修复。这里唯一需要做的似乎就是有人能关心到,真正抱怨这件事。