versioneer安装失败,并出现导入错误

时间:2018-07-13 14:27:18

标签: python

versioneer安装失败,并出现导入错误:

$ versioneer install
Traceback (most recent call last):
  File "/usr/local/bin/versioneer", line 7, in <module>
    from versioneer import main
ImportError: cannot import name 'main'

我希望versioneer命令能够成功执行。

1 个答案:

答案 0 :(得分:0)

问题是由于PYTHONPATH中的另一个versioneer隐藏了真实版本:

>>> import versioneer
>>> versioneer.__file__
'/home/<user>/<repo>/versioneer.pyc'

暂时取消设置PYTHONPATH有帮助:

$ unset PYTHONPATH
$ versioneer install
versioneer.py (0.18) installed into local tree
...