cactie
cactie

Reputation: 111

Got CondaVerificationError when installing Tensorflow

I got a CondaVerificationError when installing Tensorflow on my 64-bit Win10.

CondaVerificationError: The package for tensorflow-estimator located at C:\Users\viviennejia.zhong\AppData\Local\Continuum\anaconda3\pkgs\tensorflow-estimator-1.13.0-py37h39e3cac_0
appears to be corrupted. The path 'Lib/site-packages/tensorflow_estimator/python/estimator/canned/linear_optimizer/python/utils/__pycache__/sharded_mutable_dense_hashtable.cpython-37.pyc'
specified in the package manifest cannot be found.

ClobberError: This transaction has incompatible packages due to a shared path.
packages: conda-forge::tensorboard-1.13.1-py37_0, conda-forge::tensorflow-base-1.13.1-py37_7
path: 'scripts/tensorboard-script.py'

ClobberError: This transaction has incompatible packages due to a shared path.
packages: conda-forge::tensorboard-1.13.1-py37_0, conda-forge::tensorflow-base-1.13.1-py37_7
path: 'scripts/tensorboard.exe'

In some posts I saw conda clean --all could help. Runing this, I got

FileNotFoundError: [WinError 3] 'C:\\Users\\xxxx\\AppData\\Local\\Continuum\\anaconda3\\pkgs\\tensorflow-base-2.0.0-mkl_py37hd1d5974_0\\Lib\\site-packages\\tensorflow-2.0.0.data\\purelib\\tensorflow_core\\include\\tensorflow_core\\core\\common_runtime\\isolate_placer_inspection_required_ops_pass.h'

I am new to conda and appreciate very much your help to solve this issue.

Upvotes: 5

Views: 6030

Answers (2)

Marius Greuel
Marius Greuel

Reputation: 166

You may be running into the path length limitation in Windows.

Setting LongPathsEnabled fixed it for me.

See https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later

Upvotes: 4

user11530462
user11530462

Reputation:

Providing the solution here (Answer Section), even though it is present in the Comment Section, for the benefit of the community.

Installation of Tensorflow through pip has resolved issue

pip install tensorflow (install latest version)

or

pip install tensorflow==2.0 (for older version)

In addition to above method, there is a recommended way is to create a Virtual Environment in Anaconda and install the Tensorflow in that Virtual Environment, which works in most of the cases.

Using Virtual Environments has advantages like

  • We can maintain multiple versions of Tensorflow in multiple Virtual Environments with each Virtual Environment comprising each version like 1.14, 1.15, 2.0, 2.1, 2.2,etc..
  • We can use different Python Versions (2.x, 3.6, 3.7) in each Virtual Environment
  • If we want to modify the source code of any of the Tensorflow API, we can do it within our Virtual Environment, without impacting its functionality in other Virtual Environments.

Steps for Creating a New Virtual Environment and installing Tensorflow in Anaconda, for different Operating Systems, is shown below:

# Create a New Virtual Environment
conda create --name TF_2_VE

# When conda asks you to proceed, type y:
proceed ([y]/n)?

# Activate the Virtual Environment. Conda Version > 4.6 
conda activate TF_2_VE

# Activating Virtual Environment, Conda Version < 4.6 and Windows OS
activate TF_2_VE

# Activating Virtual Environment, Conda Version < 4.6 and Linux and Mac OS
source activate TF_2_VE


# Install the TF Version you need
conda install tensorflow

The above command will install the Latest Version of Tensorflow (2.2 as of now). If you want an older version like 2.0, you can replace the last step of the above set of commands with

conda install tensorflow==2.0.

Upvotes: 1

Related Questions