3

I am trying to install TensorFlow on Windows using Anaconda, behind a firewall.

None of the attempts

--trusted-host

pip install tensorflow --trusted-host pypi.python.org

conda create

conda create -n tensorflow pip python=3.6
activate tensorflow
pip install --ignore-installed --upgrade tensorflow

or --no-cache-dir

pip install tensorflow --no-cache-dir

let me install tensorflow using Anaconda on Windows.

The problem has to do with access permissions

> pip -v install tensorflow
...
* https://pypi.python.org/simple/tensorflow/
...
Starting new HTTPS connection (1): pypi.python.org
...
'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at ..>:
Failed to establish a new connection:
[WinError 10061] No connection could be made because the target
machine actively refused it',)': /simple/tensorflow/
...

Weirdly, I can download the whl file just fine, but afterwards

pip -v install tensorflow-1.10.0-cp36-cp36m-win_amd64.whl

Processing c:\...\tensorflow-1.10.0-cp36-cp36m-win_amd64.whl

tells me that

Collecting grpcio>=1.8.6 (from tensorflow==1.10.0)
1 location(s) to search for versions of grpcio:
* https://pypi.python.org/simple/grpcio/

So I figure I'll install the recursively needed packages manually, starting with grpcio, but neither the most recent

pip -v install grpcio-1.14.1-cp36-cp36m-win32.whl

pip.exceptions.InstallationError: grpcio-1.14.1-cp36-cp36m-win32.whl is not a supported wheel on this platform.

nor the oldest possible needed by this version of tensorflow

pip -v install grpcio-1.8.6-cp36-cp36m-win32.whl

pip.exceptions.InstallationError: grpcio-1.8.6-cp36-cp36m-win32.whl is not a supported wheel on this platform.

will install.

I am able to download from https://pypi.org/simple/* just fine. How do I use the downloaded packages to install tensorflow?

Conda 4.3.27
Python 3.6.2
Windows 7 Pro

Update 1

After the first steps of the recipe

  • Download tensorflow-1.10.0-cp36-cp36m-win_amd64.whl from pypi.org/simple
  • Put the whl file in c:/Users/vrok/.conda/envs
  • activate c:/Users/vrok/.conda/envs/

the fourth

conda install tensorflow-1.10.0-cp36-cp36m-win_amd64.whl

fails with

CondaHTTPError: HTTP 000 CONNECTION FAILED for url
<https://repo.continuum.io/pkgs/main/win-64/repodata.json.bz2>

even though I am able to download https://repo.continuum.io/pkgs/main/win-64/repodata.json.bz2 manually.

Update 2:

I'm not tied to Anaconda. Any option on Windows is good. PyCharm, IIUC, hooks on to a prior installation. It does not provide python/pip/venvs itself. Still, in Settings \ Project \ Project Interpreter, the user is not told which URL was unreachable. Knowing this would enable those behind firewalls to open, or request opening, access to specific URLs.

Related:

one, two

Alistair Carscadden
  • 1,198
  • 5
  • 18
Vrokipal
  • 784
  • 5
  • 18
  • It looks like your platform is `win_amd64`. Why did you download `grpcio` for `win32` then? I see `grpcio-1.14.1-cp36-cp36m-win_amd64.whl` on PyPI, you should install that instead. – hoefling Aug 16 '18 at 10:34
  • If you can't resolve the issue with your firewall/proxy to be able to download wheels directly with `pip`, I'd suggest to download them from another machine not having the firewall problem: `pip download --platform win_amd64 --implementation cp --python-version 36 --abi cp36m --only-binary=:all: --dest packages tensorflow` will download `tensorflow` and all dependencies recursively for your platform. Then copy the `packages` dir to your machine and install from it: `pip install tensorflow --find-links packages/`. – hoefling Aug 16 '18 at 11:06

1 Answers1

0

Why you haven't tried the obvious?

conda install -n myenv tensorflow=[your version here or leave blank for latest]

or you can do it the more interactive way:

activate [your environment]
conda install [your thing]

Then you can test your installation with

conda list