“AttributeError:'NoneType'对象在安装geopy时没有属性'split'”

时间:2013-01-12 16:44:47

标签: python django svn pip geopy

我正在尝试从django项目的需求文件安装软件包。

问题是在安装geopy时遇到错误AttributeError:'NoneType'对象没有属性'split'。

我在使用python 2.7.3的virtualenv中运行。

确切的命令是:

sudo pip-python install -r requirements.pip

需求文件中有问题的行是:

-e svn+http://geopy.googlecode.com/svn/trunk@144#egg=geopy-0.94.1_pre.dev_r144-py2.7-dev_r144

我有setuptools并分发0.6.34(我相信setuptools只是分发的别名)。 setuptools_subversion版本为3.1

我正在运行Fedora 17。

完整错误如下:

Obtaining geopy from svn+http://geopy.googlecode.com/svn/trunk@144#egg=geopy-0.94.1_pre.dev_r144-py2.7-dev_r144 (from -r requirements.pip (line 50))
  Unrecognized .svn/entries format in /home/myself/leona-integration/leona/src/geopy
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 126, in main
    self.run(options, args)
  File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 223, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/site-packages/pip/req.py", line 936, in prepare_files
    req_to_install.update_editable(not self.is_download)
  File "/usr/lib/python2.7/site-packages/pip/req.py", line 384, in update_editable
    vcs_backend.obtain(self.source_dir)
  File "/usr/lib/python2.7/site-packages/pip/vcs/subversion.py", line 86, in obtain
    if self.check_destination(dest, url, rev_options, rev_display):
  File "/usr/lib/python2.7/site-packages/pip/vcs/__init__.py", line 184, in check_destination
    if self.compare_urls(existing_url, url):
  File "/usr/lib/python2.7/site-packages/pip/vcs/__init__.py", line 142, in compare_urls
    return (self.normalize_url(url1) == self.normalize_url(url2))
  File "/usr/lib/python2.7/site-packages/pip/vcs/__init__.py", line 136, in normalize_url
    return urllib.unquote(url).rstrip('/')
  File "/usr/lib64/python2.7/urllib.py", line 1204, in unquote
    res = s.split('%')
AttributeError: 'NoneType' object has no attribute 'split'

Storing complete log in /root/.pip/pip.log

评论中已经指出,“在......中无法识别的.svn / entries格式”这一行只是一个警告,而不是异常的原因。

1 个答案:

答案 0 :(得分:0)

我通过在需求文件中注释有问题的行并添加以下行来解决它:

geopy==0.94.1