2017-09-21 188 views
-2

我在我的电脑中安装了Anaconda3并创建了一个名为python27的python版本为2.7的virtualenv,我想在我的virtualenv中安装几个软件包,但conda install或pip install适用于一些包,而不是为别人,例如,我无法安装CSV,包管理逗号分隔值文件,这是我开始使用畅达输出安装:无法安装一些与conda安装或pip安装的软件包

$ 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安装:

$ 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我无法以这种方式安装?

在此先感谢。

回答

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! 
2

您不能安装csv,因为它已经包含在您的python安装中。

刚去

import csv