InvalidArchiveError when executing conda install notebook
Asked Answered
C

3

11

I have conda 4.8.1 running on windows 10 enterprise edition and it is showing me following error whenever I try to install notebook.

InvalidArchiveError("Error with archive D:\\Miniconda3\\pkgs\\notebook-6.0.2-py37_0ujelie94\\pkg-notebook-6.0.2-py37_0.tar.zst. You probably need to delete and re-download or re-create this file. Message from libarchive was:\n\nCan't create '\\\\?\\D:\\Miniconda3\\pkgs\\notebook-6.0.2-py37_0\\Lib\\site-packages\\notebook\\static\\components\\MathJax\\extensions\\a11y\\invalid_keypress.mp3'")

I have tried different versions of notebook and reinstalled anaconda and miniconda many times. Nothing seems to work.

Compress answered 9/1, 2020 at 4:35 Comment(1)
are you trying to update through the command line on Anaconda or the Anaconda Navigator? I just tried through the Navigator and it came back to tell me that I cannot install on the environment but then asked if I wanted to install as a new environment.Pistareen
C
21

I had the same problem on Ubuntu 18.04, I used conda clean -a and then it works perfectly. Actually what conda clean -a does is cleaning the compressed .bz files and deleting older versions of package folders and does nothing to the new ones.

P.S.: Make sure you installed Anaconda or Miniconda into a directory that contains only 7-bit ASCII characters and no spaces, such as C:\anaconda!

Cephalad answered 9/5, 2020 at 6:8 Comment(3)
Works exactly the same way on windows, I had a similar problem and your solution solved it.Diligent
I had this problem on Ubuntu 16.04. conda clean -a solved it for me.Woodenhead
It only removed all my cache, settings and previous envs, and I continue with the same problem 😭Chive
M
0

For me, using pip worked. It downloaded the correct version of TensorFlow (2.16.3), which is compatible with Python 3.9.18. I had TensorFlow 2.10.0, which was giving the InvalidArchiveError.

pip install tensorflow
Meir answered 10/3 at 14:34 Comment(0)
R
0

On Windows you may need to enable "long paths" if the package being installed has many sub-directories.

In my case, conda install tensorflow=2.10.0 would produce this error.

InvalidArchiveError("Error with archive C:\\Users\\user\\AppData\\Local\\miniconda3\\pkgs\\tensorflow-base-2.10.0-mkl_py39h6a7f48e_0.conda.  You probably need to delete and re-download or re-create this file. Message was:\n\nfailed with error: [Errno 2] No such file or directory: 'C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\miniconda3\\\\pkgs\\\\tensorflow-base-2.10.0-mkl_py39h6a7f48e_0\\\\Lib\\\\site-packages\\\\tensorflow\\\\include\\\\tensorflow\\\\compiler\\\\mlir\\\\hlo\\\\_virtual_includes\\\\compose_set_interface_inc_gen\\\\mlir-hlo\\\\Dialect\\\\gml_st\\\\transforms\\\\compose_set_interface.h.inc'")

The path length of the missing directory was 329 characters. The default Windows 10 path length is 260 characters.

I toggled long paths and Tensorflow installed successfully.

Ryun answered 14/8 at 20:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.