0

I'm trying to install pandas for Python3. I ran the following command

pip3 install --user pandas

This worked perfectly with numpy instead of pandas.

And for pandas I obtain the following error that I don't know how to debug

Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-1ac09uln/pandas/setup.py", line 42
       f"numpy >= {min_numpy_ver}",
                              ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-1ac09uln/pandas/

It seems that there is a syntax error in the pandas setup file... Since the problematic line is the one dealing with the minimum numpy version I checked which version I had, and it's the 1.18.2 (latest). What should I do now ?

8
  • How about: python3 -m pip install pandas ? Commented Apr 5, 2020 at 8:56
  • $ sudo -H pip3 install -U pandas ? Commented Apr 5, 2020 at 8:57
  • That's what I've done but I obtained the error I pasted in my question Commented Apr 5, 2020 at 8:57
  • Do the same with numpy. Don't forget the -U flag; that will update the package. Commented Apr 5, 2020 at 8:59
  • I obtain another syntax error ImportError: No module named 'pip._internal' but I thought it wasn't recommended to use sudo with pip Commented Apr 5, 2020 at 8:59

1 Answer 1

1

What version of python you have installed?Is pip updated to the latest version. f-strings where introduced in python 3.6. Maybe this is the problem. In any case it should be easier to install all packages you want using an environment like anaconda so that you can have all packages needed from the start(e.g all packages needed for data science). For an alternative you can try run pip using a specific python version(try 3.6 or greater) you can find more info for this here: Install a module using pip for specific python version.

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.