How to pip install old version of library(tensorflow)?
Question:
I’m trying to install tensorflow r0.11. I tried
pip install tensorflow==r0.11
pip install tensorflow<0.12
But I get this error
Could not find a version that satisfies the requirement tensorflow==0.11.0 (from versions: 0.12.0rc0, 0.12.0rc1, 0.12.0, 0.12.1)
No matching distribution found for tensorflow==0.11.0
I assume pip is no longer support depricated versions, how can I get it?
I also tried
pip install git+git://github.com/tensorflow/[email protected]
Cloning git://github.com/tensorflow/tensorflow (to r0.11) to /private/var/folders/1p/7km73m0s2cvdfb1js3ct8_mh0000gn/T/pip-JMMIRP-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/private/var/folders/1p/7km73m0s2cvdfb1js3ct8_mh0000gn/T/pip-JMMIRP-build/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/1p/7km73m0s2cvdfb1js3ct8_mh0000gn/T/pip-JMMIRP-build/
Answers:
You can install the pip wheel from a URL directly, for example:
# Ubuntu/Linux 64-bit, CPU only, Python 2.7
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
pip install --ignore-installed --upgrade $TF_BINARY_URL
In general, installation instructions for older versions of TensorFlow can be found at :
For binaries for installation using wheels:
Go to tensorflow pypi release history, select the release of your choice, say tensorflow 1.8.0
, go to Download files and either download the wheel file and then install or copy the download link and save in TF_BINARY_URL
for your python --version
and os [mac, linux or windows] install as shown above
This works for me on Mac OS 10.13.1.
pip install --user install tensorflow==1.3.0.
If you have your own library/packet on github/gitlab etc, you have to add tag to commit with concrete version of library e.g. v2.0 then you can install your packet
pip install git+ssh://link/name/[email protected]
If you want to install tensorflow r0.11, it means that you want to install the sources from a certain branch (r0.11). Therefore, you should follow the official installation instructions from tensorflow: https://www.tensorflow.org/install/install_sources:
In case you want to install a “normal” release. then you can easily use the following command:
pip install --upgrade tensorflow==1.3.0.
This worked for me:
pip3 install 'tensorflow==1.2.0' --force-reinstall
The other answers are useful, but the question remains: why doesn’t pip have the older version? Because older TensorFlow versions were not built for the Python version you are running1. So pip can’t find them.
If you want pip to find them, use a python version which TensorFlow was built for. For example, TensorFlow 1.14.0 was built for Python3.7, as can be seen here.
1 This means both:
- no "source distributions" were published and
- no "built distributions"/
bdist_wheel
s were published for the combination of architecture, python version, and operating system.
For simple packages, source distribution can be used to compile dependencies during pip install
, but tensorflow (or pytorch) don’t provide source distributions, probably because it would unlikely work-for or suit most users, because:
- they require a lot of build dependencies on your machine, and
- the build is configurable.
I’m trying to install tensorflow r0.11. I tried
pip install tensorflow==r0.11
pip install tensorflow<0.12
But I get this error
Could not find a version that satisfies the requirement tensorflow==0.11.0 (from versions: 0.12.0rc0, 0.12.0rc1, 0.12.0, 0.12.1)
No matching distribution found for tensorflow==0.11.0
I assume pip is no longer support depricated versions, how can I get it?
I also tried
pip install git+git://github.com/tensorflow/[email protected]
Cloning git://github.com/tensorflow/tensorflow (to r0.11) to /private/var/folders/1p/7km73m0s2cvdfb1js3ct8_mh0000gn/T/pip-JMMIRP-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/private/var/folders/1p/7km73m0s2cvdfb1js3ct8_mh0000gn/T/pip-JMMIRP-build/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/1p/7km73m0s2cvdfb1js3ct8_mh0000gn/T/pip-JMMIRP-build/
You can install the pip wheel from a URL directly, for example:
# Ubuntu/Linux 64-bit, CPU only, Python 2.7
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
pip install --ignore-installed --upgrade $TF_BINARY_URL
In general, installation instructions for older versions of TensorFlow can be found at :
For binaries for installation using wheels:
Go to tensorflow pypi release history, select the release of your choice, say tensorflow 1.8.0
, go to Download files and either download the wheel file and then install or copy the download link and save in TF_BINARY_URL
for your python --version
and os [mac, linux or windows] install as shown above
This works for me on Mac OS 10.13.1.
pip install --user install tensorflow==1.3.0.
If you have your own library/packet on github/gitlab etc, you have to add tag to commit with concrete version of library e.g. v2.0 then you can install your packet
pip install git+ssh://link/name/[email protected]
If you want to install tensorflow r0.11, it means that you want to install the sources from a certain branch (r0.11). Therefore, you should follow the official installation instructions from tensorflow: https://www.tensorflow.org/install/install_sources:
In case you want to install a “normal” release. then you can easily use the following command:
pip install --upgrade tensorflow==1.3.0.
This worked for me:
pip3 install 'tensorflow==1.2.0' --force-reinstall
The other answers are useful, but the question remains: why doesn’t pip have the older version? Because older TensorFlow versions were not built for the Python version you are running1. So pip can’t find them.
If you want pip to find them, use a python version which TensorFlow was built for. For example, TensorFlow 1.14.0 was built for Python3.7, as can be seen here.
1 This means both:
- no "source distributions" were published and
- no "built distributions"/
bdist_wheel
s were published for the combination of architecture, python version, and operating system.
For simple packages, source distribution can be used to compile dependencies during pip install
, but tensorflow (or pytorch) don’t provide source distributions, probably because it would unlikely work-for or suit most users, because:
- they require a lot of build dependencies on your machine, and
- the build is configurable.