conda "没有名为 wget 的模块";在 conda 安装 wget 之后 [英] conda "No module named wget" after conda install wget

查看:296
本文介绍了conda "没有名为 wget 的模块";在 conda 安装 wget 之后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Conda seems to have installed package wget as a binary in /bin but not in the environment's site-packages:

$ 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) $

推荐答案

wget 程序不同于 Python 包 wget.后者名为 python-wget,可以从 Conda Forge

The program wget is distinct from the Python package wget. The latter goes by the name python-wget and can be installed from Conda Forge

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

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

This is one of the inherent problems with having a generic package manager that includes packages from many programming languages. The working convention that I've seen is prepending the language whenever there is a conflict. Python packages often get py- or python-, R gets r-, etc..

这篇关于conda "没有名为 wget 的模块";在 conda 安装 wget 之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆