5

My Conda (on Ubuntu 18.04) has the following error message but all functions are running correctly:

/home/td7920/miniconda3/lib/python3.8/site-packages/conda_package_streaming/package_streaming.py:19: UserWarning: zstandard could not be imported. Running without .conda support.
  warnings.warn("zstandard could not be imported. Running without .conda support.")
/home/td7920/miniconda3/lib/python3.8/site-packages/conda_package_handling/api.py:29: UserWarning: Install zstandard Python bindings for .conda support
  _warnings.warn("Install zstandard Python bindings for .conda support")
Collecting package metadata (repodata.json): | /home/td7920/miniconda3/lib/python3.8/site-packages/conda_package_streaming/package_streaming.py:19: UserWarning: zstandard could not be imported. Running without .conda support.
  warnings.warn("zstandard could not be imported. Running without .conda support.")
/home/td7920/miniconda3/lib/python3.8/site-packages/conda_package_handling/api.py:29: UserWarning: Install zstandard Python bindings for .conda support
  _warnings.warn("Install zstandard Python bindings for .conda support")

I did pip install zstandard and conda install zstandard. When I do conda list, both are found,

zstandard                 0.19.0           py38h5945529_1    conda-forge
zstd                      1.5.5.1                  pypi_0    pypi

But still get the error.

merv
  • 67,214
  • 13
  • 180
  • 245
RAN
  • 51
  • 1
  • 3
  • 2
    Only see warnings (please don't call warnings errors). Try updating `conda` and `conda-package-handling` packages. Also, you're only complicating things by bringing in PyPI. Users simply should not be install PyPI packages in **base**. Reinstall `zstd` from Conda Forge. – merv Apr 07 '23 at 16:00
  • Updating the base python to newest (in my case from 3.9 to 3.11) and then updating conda solved the problem for me. – loikein Jun 24 '23 at 18:16

3 Answers3

5

What worked for me:

pip install --upgrade --force-reinstall zstandard
pip install --upgrade --force-reinstall zstd

Received new version zstd from pip ... --force-reinstall that I did not from conda ... --force-reinstall. Have channels:

  • bioconda
  • r
  • anaconda
  • conda-forge
  • defaults

in .condarc ?

Gunther Struyf
  • 11,158
  • 2
  • 34
  • 58
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 01 '23 at 10:44
1

I am on a Windows 11 box and have exclusively used Anaconda / conda / navigator to install and update packages, avoiding at all costs using pip. Using: Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 1 2023, 18:18:15) [MSC v.1916 64 bit (AMD64)]

I too ran into this problem and tried most of the posted answers, to no avail. I tried importing zstandard in a plain conda env python window and it prompted me about conflicts between compiled versions. So I guessed a simple force installation via pip of the newest version of zstandard was a risk worth taking.

I went to https://pypi.org/project/zstandard/ got the most recent version number, at the time of this writing was 0.21.0, and within a conda env terminal window ran pip install zstandard==0.21.0 and the problem has disappeared.

For each of my environments I have done the same and have no more issues.

0

I figured out a way to fix this issue. We need to import zstandard in the following two .py files and everything will be smooth as wind.

/home/ubuntu/anaconda3/lib/python3.9/site-packages/conda_package_handling/api.py

/home/ubuntu/anaconda3/lib/python3.9/site-packages/conda_package_streaming/package_streaming.py

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129