简体   繁体   English

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

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

I installed Anaconda3 in my computer and created a virtualenv named Python27 with python version 2.7, I want to install several packages in my virtualenv, but conda install or pip install works for some packages and not for others, for example, I was not able to install csv, a package to manage comma separated values documents, this is the output I get using conda 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

and using pip install: 并使用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

How do I install the package csv in my virtualenv or any other package I was not able to install this way? 如何在我的virtualenv或无法通过这种方式安装的任何其他软件包中安装csv软件包?

Thanks in advance. 提前致谢。

You cannot install csv, because it is already included in your python installation. 您无法安装csv,因为它已包含在python安装中。

Just go 去吧

import csv

It's a standard library module: csv . 这是一个标准的库模块: csv It should be available without installation. 它应该没有安装就可用。

Just to make sure I tested it with a clean environment. 只是为了确保我在干净的环境中对其进行了测试。

$ 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