I am getting an InvalidArchiveError in anaconda prompt when I am trying to install spacy. How to solve it?
Asked Answered
J

5

23

InvalidArchiveError('Error with archive C:\Users\Sahaja Reddy\Anaconda3\pkgs\openssl-1.1.1g-he774522_0.conda. You probably need to delete and re-download or re-create this file. Message from libarchive was:\n\nCould not unlink (errno=22, retcode=-25, archive_p=1873471744752)')

Joselow answered 11/5, 2020 at 9:38 Comment(1)
I tried everything from various forums but still the error isn't getting solvedJoselow
D
37

I had this same problem - I had an IPython instance open that was holding onto the Openssl handle open so I wasn't able to delete the Openssl folder as mentioned above by Prayson. After closing all of my IPython & Python instances through the command prompt, or entering the following in a command prompt:

TASKKILL /F /IM python.exe

I was then able to run

conda install -c conda-forge libarchive

(as mentioned previously) to update the openssl library without having to actually delete anything. After that, everything went back to normal.

Dyne answered 10/6, 2020 at 1:10 Comment(1)
Worked for me as well only when I ran the kill command. Thx.Bunyabunya
M
18

The better approach is to do a cleanup

conda clean --all

https://docs.conda.io/projects/conda/en/latest/commands/clean.html

Mosenthal answered 14/12, 2020 at 11:17 Comment(0)
Q
5

InvalidArchiveError when trying to install with conda can happen if you don't have enough free space on the hard disk. Make sure you have enough free space.

Quiche answered 3/9, 2020 at 2:59 Comment(1)
Additionally, if you are running conda within a Docker image, make sure that you haven't filled up your Docker disk image. Go to Docker->Preferences->Resources and check the utilization under "Disk image size." If it's high, try following the instructions here: https://mcmap.net/q/175701/-how-can-i-reduce-the-disk-space-used-by-dockerGrebe
N
2

For windows it was a folder permisions issue

Solution reference in this site,

"Go to anaconda Find... Under the installation path Anaconda3 Folder , Right click to select Properties –> Security –> Select current computer user –> edit , Check on write in Authority –> preservation , Wait for security information to be written , Then execute again"

https://copyfuture.com/blogs-details/202203310858236776

Hope it helps

Northerly answered 13/4, 2022 at 4:9 Comment(0)
R
0

The issue is with corrupt openssl package. You need to first delete all openssl pkg files and reinstall them. This is what I did:

# as the error show where the openssl files are
cd  %USERPROFILE%\AppData\Local\Continuum\miniconda3\pkgs\
# with linux I did rm -fr openssl*
DEL /Q /F /S "openssl*"
# install openssl from libarchive
conda install -c conda-forge libarchive

That reinstall openssl and everything will be back to normal.

Ricardoricca answered 25/5, 2020 at 13:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.