简体   繁体   English

pip install与conda install

[英]pip install vs. conda install

After activating a virtualenv 激活virtualenv后

source activate myVirtualEnv

how is pip install basemap different from conda install basemap ? 如何将pip install basemapconda install basemap不同? Both gave me different results, why is that? 两者都给了我不同的结果,为什么呢?

pip install basemap pip安装底图

Collecting basemap
  Could not find a version that satisfies the requirement basemap (from versions: )
  Some externally hosted files were ignored as access to them may be unreliable (use --allow-external basemap to allow).
No matching distribution found for basemap

conda install basemap conda安装底图

Successfully installs

Pip installs from PyPI . Pip从PyPI安装。 There are no releases of the basemap package on PyPI, it is just a simple registration page pointing at the real download location ( SourceForge ). PyPI上没有底图包的版本,它只是一个指向真实下载位置的简单注册页面( SourceForge )。

Conda pulls from its own repository , typically with convenience builds of libraries common to the community Conda is aimed at. Conda从它自己的存储库中提取,通常是为了Conda所针对的社区常见的库的便利构建。 Conda's repository has a version of the basemap package available for installation, so it succeeds. Conda的存储库有一个可用于安装的底图包版本,因此它成功了。

This is not to say that Pip is "worse" than Conda in this instance, as you could easily download the package and install it with pip locally. 这并不是说在这种情况下Pip比Conda“更糟糕”,因为你可以轻松下载软件包并在本地安装pip。 This particular library has just opted to not add releases to PyPI. 这个特殊的库刚刚选择不向PyPI添加版本。

I solved this problem by example: 我通过例子解决了这个问题:

  1. conda install pip conda install pip
  2. pip install js2xml pip install js2xml

Because conda install js2xml does not work. 因为conda安装js2xml不起作用。 On the other hand, conda install openpyxl does work. 另一方面,conda install openpyxl确实有效。 How do I know which is conda and which is pip. 我怎么知道哪个是conda,哪个是pip。 There is a list provided: 提供了一个列表:

conda install js2xml

Solving environment: failed


PackagesNotFoundError: The following packages are not available from current channels:


  - js2xml


Current channels:


  - https://repo.anaconda.com/pkgs/main/linux-64

  - https://repo.anaconda.com/pkgs/main/noarch

  - https://repo.anaconda.com/pkgs/free/linux-64

  - https://repo.anaconda.com/pkgs/free/noarch

  - https://repo.anaconda.com/pkgs/r/linux-64

  - https://repo.anaconda.com/pkgs/r/noarch

  - https://repo.anaconda.com/pkgs/pro/linux-64

  - https://repo.anaconda.com/pkgs/pro/noarch


To search for alternate channels that may provide the conda package you're

looking for, navigate to


    https://anaconda.org

Sames goes for an error when trying to run python script when you added "import js2xml" whilst using acaconda/conda: ModuleNotFoundError: No module named 'js2xml' 在使用acaconda / conda时添加“import js2xml”时尝试运行python脚本时出现错误Sames:ModuleNotFoundError:没有名为'js2xml'的模块

If you use conda or anaconda, do NOT install pip by typing "sudo apt install pip". 如果您使用conda或anaconda,请不要通过键入“sudo apt install pip”来安装pip。

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

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