movermeyer/backports.datetime_fromisoformat

Installing backports-datetime-fromisoformat on Python 2 doesn't work

EliXie212 opened this issue ยท 6 comments

When I ran pip install backports-datetime-fromisoformat on ubuntu 18 in the terminal, I ran into the following error: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

And here is a screenshot of the error:
Screenshot from 2019-11-14 12-30-02

Thanks!

Hey @EliXie212,

Thanks for this report.

Judging from the screenshot, you seem to be trying to install backports-datetime-fromisoformat in Python 2.7.

However, backports-datetime-fromisoformat currently only supports Python 3, and is tested against Pyhon 3.4-3.6 (datetime.fromisoformat exists in 3.7+).

Pull Requests are welcome to add Python 2.7 support (related issue), but since Python 2 is deprecated and will be EOL'd in a month, I likely won't be implementing it myself (it's non-trivial to get right).

My install is using Python3 it seems, but still failing? Unless it's something else that's failing

image

@naimoon6450 In this case, your C compiler is unable to find the Python.h header file.

This is installed as part of the development package for Python for your platform.

  • For Redhat/CentOS, you can install this by adding the -devel suffix: yum install python-devel.
  • For Ubuntu, from a quick search, it seems to be installed using the -dev suffix: apt-get install python-dev
    For others, you'll have to search the instructions for installing the Python development headers.

Then retry the installation.

ERROR: Failed building wheel for backports-datetime-fromisoformat (can you share the command for Windows 10 64 bit) to resolve this error.

ERROR: Failed building wheel for backports-datetime-fromisoformat (can you share the command for Windows 10 64 bit) to resolve this error.

@ShivData Without an actual stack trace or more information, it's impossible to know what is causing the failure.

At minimum, you need to make sure that you have the Python development headers for your version of Python and the MSVC C compiler for it to compile.

Doing a quick search, it seems that installing Visual Studio is the easiest way to get setup.

All supported versions of Python can be built using Microsoft Visual Studio 2017 or later. You can download and use any of the free or paid versions of Visual Studio.

When installing it, select the Python development workload and the optional Python native development tools component to obtain all of the necessary build tools.

Good luck.

ERROR: Failed building wheel for backports-datetime-fromisoformat (can you share the command for Windows 10 64 bit) to resolve this error.

@ShivData Without an actual stack trace or more information, it's impossible to know what is causing the failure.

At minimum, you need to make sure that you have the Python development headers for your version of Python and the MSVC C compiler for it to compile.

Doing a quick search, it seems that installing Visual Studio is the easiest way to get setup.

All supported versions of Python can be built using Microsoft Visual Studio 2017 or later. You can download and use any of the free or paid versions of Visual Studio.
When installing it, select the Python development workload and the optional Python native development tools component to obtain all of the necessary build tools.

Good luck.

image
image
I had a similar problem when I was pip install trafilatura, python3.6. What should I do?