1
votes

I am experiencing a weird issue, on ubuntu 14.04 with python2.7.9 installed in a custom folder when trying to install tensorflow from inside a virtualenv that is using the custom python build pip doesn't seem to find tensorflow.

 virtualenv venv --python=/opt/python279/bin/python2.7
 cd venv
 source bin/activate
 pip install tensorflow

Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow

other packages install normally :/ I am utterly confused

1
There is this reference. A system requirement is Ubuntu 16.04 or later (64-bit)emartinelli
I don't get it, why does it work from outside the virtuealenv if that is the reason?LetsPlayYahtzee
also it works inside the virtualenv if I use the global python2.7.6LetsPlayYahtzee
You have a point. Did you try use this parameter virtualenv --system-site-packages on virtualenv creation?emartinelli
Most probably it's because your other Python 2.7.9 is compiled with different ABI flags. What does /opt/python279/bin/python2.7 -c "import sysconfig;abiflags=('m' if sysconfig.get_config_var('WITH_PYMALLOC') else '')+('u' if sysconfig.get_config_var('WITH_WIDE_UNICODE') else '')+('d' if sysconfig.get_config_var('WITH_PYDEBUG') else ''); print(abiflags)" print?hoefling

1 Answers

1
votes

Some time ago, I wrote a more or less comprehensive checklist for possible mismatches leading to the Could not find a version that satisfies requirement error. Although the question is specifically about MacOS, the answer is applicable to Linux also. In your case, you have an ABI mismatch: as found out in the comments,

/opt/python279/bin/python2.7 -c "import sysconfig;\
    abiflags=('m' if sysconfig.get_config_var('WITH_PYMALLOC') else '')+\
    ('u' if sysconfig.get_config_var('WITH_WIDE_UNICODE') else '')+\
    ('d' if sysconfig.get_config_var('WITH_PYDEBUG') else ''); print(abiflags)" 

returned m, indicating that this Python distribution was compiled without the wide unicode support (missing the u flag). This means that pip will install only cp27-cp27m-manylinux1_x86_64 wheels for this Python distribution. However, the only wheel tensorflow offers for Python 2.7 on Linux is the cp27-cp27mu-manylinux1_x86_64 one. To be able to install tensorflow, you'll need to build a Python 2.7 distribution with wide unicode support:

$ cd Python2.7-src
$ configure --enable-unicode=ucs4
$ make && make install