【问题标题】:conda "No module named wget" after conda install wgetconda install wget之后的conda“没有名为wget的模块”
【发布时间】:2023-04-02 13:46:01
【问题描述】:

Conda 似乎已将包 wget 作为二进制文件安装在 /bin 中,但未安装在环境的站点包中:

$ conda activate geo
(geo) $ find /home/tams00/anaconda3/envs/geo/bin/ -name "wget*"
/home/tams00/anaconda3/envs/geo/bin/wget
(geo) $ find /home/tams00/anaconda3/envs/geo/lib/ -name "wget*"
(geo) $

查看以下错误:

(geo) $ conda --version
conda 4.7.12
(geo) $ python --version
Python 3.7.3
(geo) $ which python
/home/tams00/anaconda3/envs/geo/bin/python
(geo) $ conda install wget
Collecting package metadata (repodata.json): done
Solving environment: done

# All requested packages already installed.

(geo) $ conda list wget
# packages in environment at /home/tams00/anaconda3/envs/geo:
#
# Name                    Version                   Build  Channel
wget                      1.20.1               h20c2e04_0
(geo) $ python -c "import wget"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'wget'
(geo) $

【问题讨论】:

    标签: conda wget


    【解决方案1】:

    程序wget 不同于Python 包wget。后者的名称为 python-wget,可以从 Conda Forge 安装

    conda install -n geo conda-forge::python-wget
    

    这是使用包含来自多种编程语言的包的通用包管理器的固有问题之一。我见过的工作约定是在发生冲突时预先添加语言。 Python 包经常得到py-python-,R 得到r-,等等。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-23
      • 1970-01-01
      • 2019-11-23
      • 1970-01-01
      • 1970-01-01
      • 2017-05-13
      • 1970-01-01
      • 2021-06-08
      相关资源
      最近更新 更多