使用 pip 安装在 python setup.py Egg_info 上中断
我正在尝试使用常用命令 pip install tvrenamr
通过 Pip 和 PyPI 安装我自己的程序,但是我收到以下错误:
Downloading/unpacking tvrenamr
Running setup.py egg_info for package tvrenamr
Usage: tvr [options] <file/folder>
-c: error: no such option: --egg-base
Complete output from command python setup.py egg_info:
Usage: tvr [options] <file/folder>
-c: error: no such option: --egg-base
----------------------------------------
Command python setup.py egg_info failed with error code 2
Storing complete log in /Users/george/.pip/pip.log
自从我检查以来已经有一段时间了,但我曾经能够pip 安装我的代码与我放在 PyPI 上的以前版本,但是我更新到最新的 Pip - 不确定是否会导致事情中断!
因此,当 pip 运行 python setup.py Egg_info 时,似乎正在调用 TvRenamr,或者至少已导入我的选项解析器类。
我的setup.py:tvrenamr/__init__.py
from os.path import dirname, join
from setuptools import setup, find_packages
from tvrenamr import get_version
def fread(fname):
return open(join(dirname(__file__), fname)).read()
setup(
name = 'tvrenamr',
version = get_version(),
description = 'Rename tv show files using online databases',
long_description = fread('README.markdown'),
author = 'George Hickman',
author_email = '[email protected]',
url = 'http://github.com/ghickman/tvrenamr',
license = 'MIT',
packages = find_packages(exclude=['tests']),
entry_points = {'console_scripts': ['tvr = tvrenamr.tvrenamr:run',],},
classifiers = [
'Environment :: Console',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.6',
'Topic :: Multimedia',
'Topic :: Utilities',
'Natural Language :: English'],
install_requires = ('lxml', 'pyyaml',)
)
:
__version__ = (3, 0, 0)
def get_version():
return '.'.join(map(str, __version__))
我现在对如何获取tvrenamr选项的唯一想法是find_packages或>entry_points 选项以某种方式导入tvrenamr.py
,因此options.py
?
所有版本的 TvRenamr 均已使用 python setup.py sdist upload
上传到 PyPI。
我真的被这个问题难住了 - 非常感谢任何帮助!
编辑:我可以运行 python setup.py Egg_info
没有错误。
I'm trying to install my own program via Pip and the PyPI with the usual command pip install tvrenamr
however I'm getting the error below:
Downloading/unpacking tvrenamr
Running setup.py egg_info for package tvrenamr
Usage: tvr [options] <file/folder>
-c: error: no such option: --egg-base
Complete output from command python setup.py egg_info:
Usage: tvr [options] <file/folder>
-c: error: no such option: --egg-base
----------------------------------------
Command python setup.py egg_info failed with error code 2
Storing complete log in /Users/george/.pip/pip.log
It's been a while since I checked but I used to be able to pip install my code with the previous versions I put on the PyPI, however I updated to the latest Pip - not sure if would cause things to break or not!
So when pip is running python setup.py egg_info
it seems that TvRenamr is being called, or at least my option parser class has been imported.
My setup.py
:
from os.path import dirname, join
from setuptools import setup, find_packages
from tvrenamr import get_version
def fread(fname):
return open(join(dirname(__file__), fname)).read()
setup(
name = 'tvrenamr',
version = get_version(),
description = 'Rename tv show files using online databases',
long_description = fread('README.markdown'),
author = 'George Hickman',
author_email = '[email protected]',
url = 'http://github.com/ghickman/tvrenamr',
license = 'MIT',
packages = find_packages(exclude=['tests']),
entry_points = {'console_scripts': ['tvr = tvrenamr.tvrenamr:run',],},
classifiers = [
'Environment :: Console',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.6',
'Topic :: Multimedia',
'Topic :: Utilities',
'Natural Language :: English'],
install_requires = ('lxml', 'pyyaml',)
)
tvrenamr/__init__.py
:
__version__ = (3, 0, 0)
def get_version():
return '.'.join(map(str, __version__))
My only thoughts on how it's getting tvrenamr's options now are that either find_packages
or the entry_points
option are in some way importing tvrenamr.py
and thus options.py
??
All versions of TvRenamr were uploaded to the PyPI with python setup.py sdist upload
.
I really am stumped with this problem - any help much appreciated!
EDIT: I can run python setup.py egg_info
with no errors.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这是安装工具掩盖了 setup.py 中的错误的情况,该错误是由 tvrenamr/__init__.py 中的错误版本字符串引起的。
在使用 python setup.py install 手动安装到干净的 virtualenv 中后,我发现了这个错误,所以我的环境中的某些东西之前肯定也已经影响过。
Unfortunately this was a case of setup tools masking an error in the setup.py that was being caused by a bad version string in
tvrenamr/__init__.py
.I picked up on the error after installing manually with
python setup.py install
into a clean virtualenv so something in my environment must have been affecting things before too.