简体   繁体   中英

pip install vs. conda install

After activating a virtualenv

source activate myVirtualEnv

how is pip install basemap different from conda install basemap ? Both gave me different results, why is that?

pip install basemap

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

Successfully installs

Pip installs from 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 ).

Conda pulls from its own repository , typically with convenience builds of libraries common to the community Conda is aimed at. Conda's repository has a version of the basemap package available for installation, so it succeeds.

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. This particular library has just opted to not add releases to PyPI.

I solved this problem by example:

  1. conda install pip
  2. pip install js2xml

Because conda install js2xml does not work. On the other hand, conda install openpyxl does work. How do I know which is conda and which is 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'

If you use conda or anaconda, do NOT install pip by typing "sudo apt install pip".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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