Lucas
Lucas

Reputation: 675

Installing TensorFlow with pipenv gives error

I'm trying to install TensorFlow using pipenv.

This is my Pipfile:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pylint = "*"

[packages]
python-telegram-bot = "*"
imdbpy = "*"
matplotlib = "*"
scikit-image = "*"
scikit-learn = "*"
tensorflow = "*"

[requires]
python_version = "3.8"

I then run:

pipenv install tensorflow

Which outputs:

Installing tensorflow…
Adding tensorflow to Pipfile's [packages]…
Installation Succeeded
Pipfile.lock (989c3d) out of date, updating to (0d6760)…
Locking [dev-packages] dependencies…
Success!
Locking [packages] dependencies…
Locking Failed!

Followed by a big traceback that ends with:

pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in C:\Users\lucas\AppData\Local\Temp\tmpyh639mq4build\functools32\

My virtual environment uses Python 3.8.0 64 bit.

What am I doing wrong?

Upvotes: 2

Views: 5269

Answers (1)

pablosjv
pablosjv

Reputation: 673

As the comments pointed out, Tensorflow only supports up to python 3.7 (as March 2020). You can find more info in the system requirements page of the documentation.

So, to fix your issue:

  1. Remove the virtual environment with pipenv --rm
  2. Remove the Pipfile.lock
  3. Change the last lines of your Pipfile to
    [requires]
    python_version = "3.7"
    
  4. Run pipenv install --dev to recreate the environment again and pipenv install tensorflow to install tensorflow

Done!

Upvotes: 5

Related Questions