0

I have git pulled a python package (I think that is the correct terminology) that I already had installed and working.

So now it is up to date, apparently I needed to update it using pip. I did the following:

pip install the_package --upgrade 

But I got the following error message:

Exception:
Traceback (most recent call last):
File "/opt/work/python/2.7.13/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
 status = self.run(options, args)
File "/opt/work/python/2.7.13/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run
 wb.build(autobuilding=True)
File "/opt/work/python/2.7.13/lib/python2.7/site-packages/pip/wheel.py", line 749, in build
 self.requirement_set.prepare_files(self.finder)
File "/opt/work/python/2.7.13/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
 ignore_dependencies=self.ignore_dependencies))
File "/opt/work/python/2.7.13/lib/python2.7/site-packages/pip/req/req_set.py", line 666, in _prepare_file
 check_dist_requires_python(dist)
File "/opt/work/python/2.7.13/lib/python2.7/site-packages/pip/utils/packaging.py", line 48, in check_dist_requires_python
 feed_parser.feed(metadata)
File "/opt/work/python/2.7.13/lib/python2.7/email/feedparser.py", line 177, in feed
 self._input.push(data)
File "/opt/work/python/2.7.13/lib/python2.7/email/feedparser.py", line 99, in push
 parts = data.splitlines(True)
AttributeError: 'NoneType' object has no attribute 'splitlines'

I'm not sure what the problem is. Could someone please point me in the right direction?

3
  • 1
    This may be a bug in pip. Try upgrading that first. Commented Jun 30, 2018 at 14:13
  • Oh really? I did try to upgrade pip and then it stopped working altogether. I only just got it back to the working old version. Hmm. Commented Jun 30, 2018 at 14:18
  • This error is known for pip>=9 with pip failing to read some packages dist info. Can you temporarily downgrade pip to 8.1.2 (pip install "pip<9") and retry upgrading the package? Commented Jun 30, 2018 at 23:32

1 Answer 1

1

I can't say much about the error you're seeing, but my best guess is that the version of the package from git is interfering with the pip installed one. Perhaps something went wrong when trying to upgrade starting with the gitHub version (or wherever it came from) and not with an officially published one.

If a package is available through PyPI you shouldn't need to do anything besides pip install <somepackage>. I would recommend removing all files downloaded via git and those modules in your python lib so you can start over completely. From there just use pip install <packagename>.

If you're not already in a python virtual environment I would recommend creating one too, so that these things are easier to fix.

Edit: I just found elsewhere on this site that you can use pip show <packagename> to show the install location of the package if you're not in a venv (or if you are).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.