繁体   English   中英

无法使用conda install或pip install安装某些软件包

[英]can't install some packages with conda install or pip install

我在计算机上安装了Anaconda3,并使用python 2.7版创建了一个名为Python27的virtualenv,我想在virtualenv中安装多个软件包,但是conda install或pip install适用于某些软件包而不适用于其他软件包,例如,我无法安装csv,一个用于管理逗号分隔值文档的软件包,这是我使用conda install获得的输出:

$ conda install csv
Fetching package metadata .........

PackageNotFoundError: Packages missing in current channels:

  - csv

We have searched for the packages in the following channels:

  - https://repo.continuum.io/pkgs/free/linux-64
  - https://repo.continuum.io/pkgs/free/noarch
  - https://repo.continuum.io/pkgs/r/linux-64
  - https://repo.continuum.io/pkgs/r/noarch
  - https://repo.continuum.io/pkgs/pro/linux-64
  - https://repo.continuum.io/pkgs/pro/noarch

并使用pip install:

$ pip install csv
Collecting csv
Could not find a version that satisfies the requirement csv (from versions: )
No matching distribution found for csv

如何在我的virtualenv或无法通过这种方式安装的任何其他软件包中安装csv软件包?

提前致谢。

您无法安装csv,因为它已包含在python安装中。

去吧

import csv

这是一个标准的库模块: csv 它应该没有安装就可用。

只是为了确保我在干净的环境中对其进行了测试。

$ conda create -n test python   # new environment without any additional packages
$ activate test                 # go to that environment
$ python                        # start the python interpreter
>>> import csv                  # importing it works!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM