Difficulties with PIP

As I have noted before, the foundation for my work in Python is built on first installing the Xcode Command Line tools, then install MacPorts, then installing (using MacPorts) Python and PIP. Everything I then install within my Python setup, which is pretty much everything else, is done using PIP, so when I kept getting the error below after finally acquiescing to macOS’s demands to upgrade to High Sierra, I was more than a little concerned:

ImportError: No module named 'packaging'

See below for the complete traceback.1

I tried install setuptools using MacPorts, as well as uninstalling PIP. I eventually even uninstalled both Python and PIP and restarted my machine. No joy.

Joy came with this SO thread which suggested I try:

wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

Everything seems to be in working order now.

Traceback (most recent call last):
  File "/opt/local/bin/pip", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/Users/john/Library/Python/3.4/lib/python/site-packages/pkg_resources/__init__.py", line 70, in <module>
    import packaging.version
ImportError: No module named 'packaging'
~ % sudo pip search jupyter
Traceback (most recent call last):
  File "/opt/local/bin/pip", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/Users/john/Library/Python/3.4/lib/python/site-packages/pkg_resources/__init__.py", line 70, in <module>
    import packaging.version
ImportError: No module named 'packaging'
~ % sudo pip install setuptools
Traceback (most recent call last):
  File "/opt/local/bin/pip", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/Users/john/Library/Python/3.4/lib/python/site-packages/pkg_resources/__init__.py", line 70, in <module>
    import packaging.version
ImportError: No module named 'packaging'

  1. For those interested, the complete traceback looked like this: 

Classifiers

When considering a classifier, effectiveness can be considered in terms of accuracy as well as precision and recall. (Precision and recall seem to mirror “senstivity/specificity”, unless I am misunderstanding those terms.)

Bookends, at last

In September 2016, frustrated with data that had gone missing in a transition between versions of the reference manager I had been using and liked very much, I listed the following specifications for what I wanted in such an application:

  • drag and drop input with autocompletion of data fields with as few clicks as possible;
  • storage of documents in human-recognizable containers: articles, books, etc. with names that look like in-text citation: e.g., Glassie_1982.pdf;
  • ability to scan PDF for highlights and notes and to print those notes and highlights separately;
  • ability to indicate if physical copy is present — or if physical copy is only copy — and its location — the ability to check out a physical copy would be useful;
  • ability to handle epubs gracefully — being able to read and mark them up within the app would be nice.

I am relieved to note that Bookends has much of this. For most items with a DOI, it can fairly quickly grab all the needed metadata — there really is no reason that at this moment in time anyone needs to spend time filling in those fields themselves. (I should note that occasionally Bookends either confuses the order of author’s names in BibTex files or, perhaps, that information is recorded properly in BibTex.)

While I do wish that Bookends would give me the option of replacing spaces with underscores automagically, when it offers to rename files it does so sensibly and in a human-readable form and in a location of my choosing.

Bookends’ tagging system remains opaque to me, but I’ve compensated by creating groups that do much of the work of tags. I’ll live with it.