0

I want to use the following PyPI Package on macOS Catalina: https://pypi.org/project/readability/

What the Package does: Analyses .txt files you have in a certain directory and then gives you a .csv file containing readability values for all the examined .txt files.

My Problem: You can run this package using one simple command in Terminal. I was able to execute that command before but I forgot to save it and now I am sitting here and don't know what to do.

I am trying to run the following command:

$readability [--lang=<en>] --csv /Users/XXXX/Desktop/1980/*.txt >readabilitymeasures.csv

But I always get this error:

-bash: en: No such file or directory

It should be so simple because I managed it before but I reallyd don't know why it doesn't work.

This is the output I get when I try to pip install readability:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: readability in ./Library/Python/2.7/lib/python/site-packages (0.3.1)

1 Answer 1

0

Bash doesn't like square brackets, it treats the contents as a conditional test. "<" and">" also get interpreted as redirectors. Your error bash: en: No such file or directory comes from bash thinking you want to redirect a file called "en". The square and angle brackets were probably in the package's documentation to indicate that they were variables that could be changed. This should work

readability --lang=en --csv /Users/XXXX/Desktop/1980/*.txt > readabilitymeasures.csv
4
  • Thank you so much! But now I get a different error: -bash: readability: command not found I really don't get what is wrong with "readability" @pgcudahy
    – paschy96
    Feb 13, 2020 at 12:23
  • Did you install readability with pip install readability? Is the installation directory in your $PATH? It sounds like you're about to take a trip through the nightmare that is python environments.
    – pgcudahy
    Feb 13, 2020 at 12:31
  • Yes I did it with pip install only thin I noticed is that I got a warning from terminal or pip (idk) that python 2.7 support ended on 01.01.2020. But as far as I red everything should still work. What do you mean with $path? @pgcudahy
    – paschy96
    Feb 13, 2020 at 12:39
  • Yes but it seems like I just had Python 2 - I did pip3 install now and it works! And thank you for your help with the brackets !! @pgcudahy
    – paschy96
    Feb 13, 2020 at 14:11

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.