2

I'm installing some additional packages to anaconda and I can't get them to work. One such package is pydicom which I downloaded, unziped, and moved to /usr/local/anaconda/lib/python2.7/site-package/pydicom. In the pydicom folder the is a subfolder called source which contains both ez_setup.py and setup.py. I ran sudo python setup.py install which didn't spit out any errors and then ran sudo python ez_setup.py install when I still couldn't get the module to open in ipython. Now I can successfully import dicom but ONLY when my current directory is /usr/local/anaconda/lib/python2.7/site-package/pydicom/source. How do I get it so I import it from any directory? I'm running CentOS and I put

export PATH=/usr/local/anaconda/bin:$PATH export PATH=/usr/local/anaconda/lib/python2.7/:$PATH in my .bashrc file.

Suever
  • 64,497
  • 14
  • 82
  • 101
G Warner
  • 1,309
  • 1
  • 15
  • 27
  • Don't install archives manually. Use `pip install ` instead. – cel Feb 26 '15 at 20:09
  • When I try that I get this error: `Command /usr/local/anaconda/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_gcw8/pydicom/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-TdTVZf-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_gcw8/pydicom Storing debug log for failure in /PHShome/gcw8/.pip/pip.log` – G Warner Feb 26 '15 at 20:28
  • What is the error message in the /PHShome/gcw8/.pip/pip.log file? – asmeurer Feb 27 '15 at 16:52

1 Answers1

1

You shouldn't copy the source to site-packages directly. Rather, use python setup.py install in the source directory, or use pip install .. Make sure your Python is indeed the one in /usr/local/anaconda, especially if you use sudo (which in general is not necessary and not recommended with Anaconda).

asmeurer
  • 86,894
  • 26
  • 169
  • 240