7

I am trying out Anaconda on OS X and need to install the python package "npTDMS".

I tried

conda install nptdms

which gave me an error

Error: No packages found in current osx-64 channels matching: nptdms You can search for this package on Binstar with

binstar search -t conda nptdms

So I tried that which found a package auto/nptdms for linux-64, which I assume won't work.

So, after some digging, I found instructions here

and tried

conda skeleton pypi npTDMS
conda build npTMDS

which seemed to work (the tests passed.)

But then

import nptmds

returns

ImportError: No module named nptdms

So I tried

conda pipbuild nptdms

which finished after a while with the error

Error: package/name must be lowercase, got: u'npTDMS'

Can someone point me to a better set of instruction?

Community
  • 1
  • 1
pheon
  • 2,867
  • 3
  • 26
  • 33

3 Answers3

9
pip install npTDMS

There's nothing magical about Python run by Conda. It can have access to Python packages anywhere, so long as they're in your path. Installing a package through the simplest way (generally pip or easy_install) should work fine.

(Also, "import nptmds" is not correct; try "from nptdms import TdmsFile")

iayork
  • 6,420
  • 8
  • 44
  • 49
  • 2
    So why use conda at all? Why not install everything using pip? – pheon Apr 24 '15 at 17:52
  • 1
    Conda is more than just an install manager, but if an install manager is all you want then you can install everything using pip. – iayork Apr 24 '15 at 18:12
  • 1
    Then I am confused about the difference between a package manager (conda) and an application that installs packages (pip) (Wikipedia calls both pip and condo "package managers"). The only difference mentioned is that conda "Conda installs the Python programming language, while similar cross-platform package managers wheel or pip do not." Is that all? – pheon Apr 24 '15 at 18:48
  • 1
    http://stackoverflow.com/questions/20994716/what-is-the-difference-between-pip-and-conda – iayork Apr 24 '15 at 19:30
  • But I suppose the question is still open why the combination "conda skeleton pypi npTDMS; conda build npTMDS" did not work. – pheon Apr 24 '15 at 22:43
  • Did you try "from nptdms import TdmsFile" with that build? Did "import nptmds" work with any other versions of python? Without trying it myself, I'd guess that either your import statement wasn't right, or that the path of the built package didn't match with the condo python. – iayork Apr 24 '15 at 22:58
  • Yes. I tried "from nptdms import TdmsFile" with that build and got "ImportError: No module named nptdms". How do I check the path is right? – pheon Apr 25 '15 at 00:11
  • `conda build` will only create the package. You can then distribute it (e.g. anaconda.org) and install with `conda install` into a conda environment. – faph Oct 06 '15 at 09:43
  • I thought you weren't supposed to use pip with conda? – endolith Feb 22 '16 at 05:35
  • Using pip for something that there's a condo package for does get confusing, but if condo doesn't have the package using pip for it works fine – iayork Feb 22 '16 at 10:53
1

pip is a package manager for Python. As I understand: conda can be used as a package manager for Python and other languages, as an inspection manager, etc.

LPYL
  • 26
  • 2
0

Conda environments (default 'root' on install) encapsulate and manage recipes that can leverage other package managers like pip (anaconda/bin/pip). If the conda environment you want to install a PYTHON package into is already active in your path, then you can directly use pip. If not, you should use the full path to pip within the conda environment directory you want to install to.

Also, you can always check conda channels to look for builds/recipes of packages that aren't available by default in pip or conda. This includes non-python packages. Many of these channels are discipline-specific.

For example, I routinely use the bioconda channel which includes bioinformatics recipes. This is how I actively manage software like the bowtie2 aligner.

$ conda config --add channels bioconda
$ conda install bowtie2
genomer
  • 1
  • 3