Anaconda pip standalone installation including dependencies (tensorflow)

I want to install tensorflow in anaconda environment on a system without internet connection and where I do not have root access (i.e. I only want to install it for my local user)

I have downloaded .whl files with tensorflow and required dependencies and copied them over to the machine I want to use. When I enter my anaconda environment, I started to install packages with

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

But when I want to install a package that depends on a previously installed package, it cannot find it.

So I wonder how you can tell where to look for dependencies? Can I install tensorflow in an easier way, still standalone and no root?

+3


source to share


1 answer


I am using PyCharm for development with anaconda. I also ran into a problem while installing tensorflow using conda, I also installed python 3.6 and followed the steps given on tensorflow website. But finally I solved it by using below steps and running it in pyCharm:

Step 1: I have downloaded the binaries (.whl) file of tensorflow file (binaries links are in the git page https://github.com/tensorflow/tensorflow )

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 the Tensorflow files were created in the location below:

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

      

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

Step 4: Tensorflow is installed, but below error appears when running the base 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 solved this error by using the protocol buffer protocol setting

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

      

Step 6: After that, 3 files "protobuf-3.3.0-py3.6-nspkg.pth", "protobuf-3.3.0-py3.6.egg-info" and "google" are created at the bottom location:

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

      

These three files should be pasted into the Anaconda site packages. (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 there are still some errors, all dependencies should be downloaded and installed similarly to step 2 or 5 from https://pypi.python.org/pypi/tensorflow . Important note: I was using Windows Command Prompt with administrator access.

+3


source







All Articles