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

时间:2017-09-21 13:50:01

标签: python csv pip anaconda conda

我在我的计算机上安装了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?

提前致谢。

2 个答案:

答案 0 :(得分:2)

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

快去

import csv

答案 1 :(得分:0)

这是一个标准的库模块: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!