X. Zhang
X. Zhang

Reputation: 418

Conda SafetyError: file has an incorrect size

When creating a Conda Environment using conda create -n env_name python=3.6, I received the warning below.

Preparing transaction: done
Verifying transaction: \ 
SafetyError: The package for python located at /anaconda3/pkgs/python-3.6.8-haf84260_0
appears to be corrupted. The path 'lib/python3.6/distutils/unixccompiler.py'
has an incorrect size.
  reported size: 14583 bytes
  actual size: 14902 bytes

done
Executing transaction: done

As the error message states, only Python 3.6.8 file is corrupted, no warning when using conda create -n env_name python=3.6.3.

Questions:

Upvotes: 15

Views: 11606

Answers (1)

BarryPye
BarryPye

Reputation: 2082

While the conda clean -a (1) command will

Remove index cache, lock files, unused cache packages, and tarballs.

This did not resolve the SafetyError when the conda create command was repeated.

Instead, the offending directory was removed using:

/bin/rm -rf /anaconda3/pkgs/python-3.6.8-haf84260_0

The content was downloaded when the conda create command was repeated.

Upvotes: 11

Related Questions