Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • I haven't touch this compiler file. What are the typical reasons for such corruption?

  • How to fix this corruption without reinstall Conda?

like image 985
X. Zhang Avatar asked Jul 22 '19 17:07

X. Zhang


1 Answers

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.

like image 78
BarryPye Avatar answered Oct 02 '22 11:10

BarryPye