0

I tried the command pip install resume-parser but I get the following error:

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. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.

Defaulting to user installation because normal site-packages is not writeable
Collecting resume-parser
  Using cached resume_parser-0.6.tar.gz (4.9 MB)

    ERROR: Command errored out with exit status 1:
     command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/7q/gt1dzy7d1js5xbdmw1x36f_00000gn/T/pip-install-95AZbT/resume-parser/setup.py'"'"'; __file__='"'"'/private/var/folders/7q/gt1dzy7d1js5xbdmw1x36f_00000gn/T/pip-install-95AZbT/resume-parser/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/7q/gt1dzy7d1js5xbdmw1x36f_00000gn/T/pip-pip-egg-info-BbhRgU
         cwd: /private/var/folders/7q/gt1dzy7d1js5xbdmw1x36f_00000gn/T/pip-install-95AZbT/resume-parser/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/7q/gt1dzy7d1js5xbdmw1x36f_00000gn/T/pip-install-95AZbT/resume-parser/setup.py", line 15, in <module>
        long_description=open('README.rst', encoding="utf8").read(),
    TypeError: 'encoding' is an invalid keyword argument for this function
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

How can I fix this?

1 Answers1

0

It looks like according to this project's classifiers that it supports Python 3 only, while you are evidently using Python 2.7.* That is also supported by the traceback shown, where Python 2's open() does not take encoding as a keyword argument, whereas Python 3 does.

Install the package using python3 -m pip install or python -m pip install where python links to Python3.

*Technically it could add python_requires as a harder check, but the open() error makes it pretty clear that it is Python3-centric.

Brad Solomon
  • 38,521
  • 31
  • 149
  • 235
  • Thanks for your Answer :) I tried "python3 -m pip install" and the other command "python -m pip install", but I got the message = ERROR: You must give at least one requirement to install (see "pip help install") WARNING: You are using pip version 19.2.3, however version 20.3.3 is available. You should consider upgrading via the 'pip install --upgrade pip' command. – questioner Dec 29 '20 at 13:59
  • You need to pass the `resume-parser` package name as a positional argument, as shown in your question, to tell pip what to install. – Brad Solomon Dec 29 '20 at 14:25
  • I tried this and got 2 errors = ERROR: pdfplumber 0.5.25 has requirement pdfminer.six==20200517, but you'll have pdfminer-six 20201018 which is incompatible. ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/3.8' Consider using the `--user` option or check the permissions. – questioner Dec 29 '20 at 15:34