0

I am trying to install tensorflow so that it works with Python 2 but am unable to. I seem to have issues with getting pip to work with Python 2. I mainly use Python 3.7.6, but need to install a repo which requires Python 2 and tensorflow 1: https://github.com/tensorflow/models/tree/master/research/autoaugment

While I was able to install tensorflow 1 using pip install tensorflow==1.15.0, this only works for Python 3. I am unable to get this to work for Python 2. When I try to import tensorflow with Python 2, I get a no module named tensorflow error. I tried the following line, python2 -m pip install tensorflow==1.15.0, but I get a no module named pip error. Again, pip works perfectly fine with Python 3 but not with python 2, and I'm not sure how to fix this. I tried sudo easy_install pip but that does not seem to have any affect on getting pip to work for Python 2.

In summary, I can't pip install Tensorflow 1.15.0 for Python 2 due to issues with pip installing working with Python 2. Any suggestions would be greatly appreciated!

Virtualenv and Python Paths:

virtualenv env
source env/bin/activate
which python2
# prints /usr/bin/python2
which python3
# prints /Users/{user_name}/Documents/{folder_name}/env/bin/python3
which python
# print /Users/{user_name}/Documents/{folder_name}/env/bin/python
Jane Sully
  • 3,137
  • 10
  • 48
  • 87
  • How exactly did you creat the Python 2 virtualenv? Where exactly is Python 2 installed? Please [edit] your question to provide these details. – tripleee Jul 13 '20 at 06:02
  • I added the code to create the virtualenv. I didn't specify Python 2 so that might be the issue? I also added the python paths. – Jane Sully Jul 13 '20 at 06:45
  • Inside the env, what does `python --version` print? You can create a Python 2 venv by specifying the version on the command line, or by explicitly invoking the Pthon 2 `virtualenv` tool. – tripleee Jul 13 '20 at 07:07

0 Answers0