Python – Anaconda pip offline installation including dependencies (tensorflow)

Anaconda pip offline installation including dependencies (tensorflow)… here is a solution to the problem.

Anaconda pip offline installation including dependencies (tensorflow)

I

want to install TensorFlow in an anaconda environment on a system without an internet connection, and I don’t have root access (i.e. I just want to install it to my local user).

I’ve downloaded the .whl file for tensorflow and the dependencies I need and copied them to the machine I’m going to use. Once in the anaconda environment, I started installing

packages

pip install -b working_directory/build -t working_directory/target package.whl

But when I want to install a package that depends on an earlier installation package, it can’t find it.

So I’m wondering, how do you tell pip where to look for dependencies? Can I install tensorflow in a simpler way and still be offline and without root?

Solution

I’m using PyCharm for anaconda development. I also had trouble installing TensorFlow using Conda, and I also installed Python 3.6 and used the steps given on the TensorFlow website. But in the end I solved this problem using the following steps and got it to run on pyCharm

:

Step 1: I downloaded the binary (.whl) for TensorFlow (the link to the binary is on the git page .) https://github.com/tensorflow/tensorflow given above).

Step 2: Then I installed tensorflow:: offline using the following command

pip.exe install --upgrade --no-deps C:\Important_Software\tensorflow-1.3.0rc0-cp36-cp36m-win_amd64.whl

Step 3: Then create the Tensorflow file at:

C:\Program Files\Python36\Lib\site-packages

I copied these files and pasted them into the Anaconda site pip package (Anaconda3\Lib\site-packages).

Step 4: Tensorflow is installed, but I get the following error when running the basic program:

  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
ModuleNotFoundError: No module named 'google'

Step 5: I have solved this error by installing the protocol buffer using pip

pip.exe install --upgrade --no-deps "C:\TarFile_location\protobuf-3.3.0.tar.gz"

Step 6: Create 3 files below “protobuf-3.3.0-py3.6-nspkg.pth”

, “protobuf-3.3.0-py3.6.egg-info” and “google” pip

:

C:\Program Files\Python36\Lib\site-packages

These three files should be pasted in the Anaconda station pip package. (Anaconda3\Lib\site-packages)

Step 6: I ran the following program and it worked:

  import tensorflow as tf
  hello = tf.constant('Hello, TensorFlow!')
  sess = tf. Session()
  print(sess.run(hello))

If you still have some errors, you must download and install all dependencies, similar to https://pypi.python.org/pypi/tensorflow Step 2 or Step 5 in | .
Important: I am using a Windows command prompt with administrator privileges.

Related Problems and Solutions