0
votes

I'm not yet very experienced with programming. I'm trying to install this module onto Canopy and I'm having some trouble (POPPY, a physical optics simulation module). The instructions for installation (found here) tell me to do the pip install, which I do below. The error message says I need the astropy module. I have astropy installed on Canopy, but this doesn't seem to recognize that.

Do I need the astropy module to be installed elsewhere?

Here's what it says:

ME$ pip install poppy --upgrade

Downloading/unpacking poppy Downloading poppy-0.3.tar.gz (1.6MB): 1.6MB downloaded Running setup.py egg_info for package poppy Traceback (most recent call last): File "", line 16, in File "/private/var/folders/-G/-GUFgmQKF2ysFZMLTUvftE+++TI/-Tmp-/pip_build_ME/poppy/setup.py", line 12, in "module" import astropy ImportError: No module named astropy Complete output from command python setup.py egg_info: Traceback (most recent call last):

File "", line 16, in

File "/private/var/folders/-G/-GUFgmQKF2ysFZMLTUvftE+++TI/-Tmp-/pip_build_ME/poppy/setup.py", line 12, in

import astropy

ImportError: No module named astropy

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/-G/-GUFgmQKF2ysFZMLTUvftE+++TI/-Tmp-/pip_build_ME/poppy
Storing complete log in /Users/ME/.pip/pip.log

I'm not sure if this is related, but I also tried "pip install poppy" (without "--upgrade"). The error was a bit different, but presumably related. Here's what it gave:


ME$ pip install poppy Downloading/unpacking poppy Downloading poppy-0.3.tar.gz (1.6MB): 1.6MB downloaded Running setup.py (path:/Users/ME/Library/Enthought/Canopy_64bit/User/build/poppy/setup.py) egg_info for package poppy WARNING: AstropyDeprecationWarning: astropy.setup_helpers.update_package_files is deprecated. Update your setup.py to use astropy.setup_helpers.get_package_info instead. [astropy.setup_helpers]

Installing collected packages: poppy Running setup.py install for poppy WARNING: AstropyDeprecationWarning: astropy.setup_helpers.update_package_files is deprecated. Update your setup.py to use astropy.setup_helpers.get_package_info instead. [astropy.setup_helpers] generating default poppy.cfg file Traceback (most recent call last): File "", line 1, in File "/Users/ME/Library/Enthought/Canopy_64bit/User/build/poppy/setup.py", line 144, in use_2to3=False File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/core.py", line 152, in setup dist.run_commands() File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/Users/ME/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/command/install.py", line 53, in run return _install.run(self) File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/command/install.py", line 563, in run self.run_command('build') File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/command/build.py", line 127, in run self.run_command(cmd_name) File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/Users/ME/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/astropy/setup_helpers.py", line 631, in run for k, (fnsrc, v) in six.iteritems(self.distribution.command_options['pytest']): KeyError: 'pytest' Complete output from command /Users/ME/Library/Enthought/Canopy_64bit/User/bin/python -c "import setuptools, tokenize;file='/Users/ME/Library/Enthought/Canopy_64bit/User/build/poppy/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/-G/-GUFgmQKF2ysFZMLTUvftE+++TI/-Tmp-/pip-CyYl8x-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ME/Library/Enthought/Canopy_64bit/User/include/site/python2.7: WARNING: AstropyDeprecationWarning: astropy.setup_helpers.update_package_files is deprecated. Update your setup.py to use astropy.setup_helpers.get_package_info instead. [astropy.setup_helpers]

running install

running build

running build_py

creating build

creating build/lib.macosx-10.6-x86_64-2.7

creating build/lib.macosx-10.6-x86_64-2.7/poppy

copying poppy/init.py -> build/lib.macosx-10.6-x86_64-2.7/poppy

copying poppy/conf.py -> build/lib.macosx-10.6-x86_64-2.7/poppy

copying poppy/cython_version.py -> build/lib.macosx-10.6-x86_64-2.7/poppy

copying poppy/fwcentroid.py -> build/lib.macosx-10.6-x86_64-2.7/poppy

copying poppy/instrument.py -> build/lib.macosx-10.6-x86_64-2.7/poppy

copying poppy/matrixDFT.py -> build/lib.macosx-10.6-x86_64-2.7/poppy

copying poppy/poppy_core.py -> build/lib.macosx-10.6-x86_64-2.7/poppy

copying poppy/utils.py -> build/lib.macosx-10.6-x86_64-2.7/poppy

copying poppy/version.py -> build/lib.macosx-10.6-x86_64-2.7/poppy

copying poppy/wfe.py -> build/lib.macosx-10.6-x86_64-2.7/poppy

creating build/lib.macosx-10.6-x86_64-2.7/poppy/tests

copying poppy/tests/init.py -> build/lib.macosx-10.6-x86_64-2.7/poppy/tests

copying poppy/tests/test_core.py -> build/lib.macosx-10.6-x86_64-2.7/poppy/tests

copying poppy/tests/test_fft.py -> build/lib.macosx-10.6-x86_64-2.7/poppy/tests

copying poppy/tests/test_nonsquare.py -> build/lib.macosx-10.6-x86_64-2.7/poppy/tests

copying poppy/tests/test_optics.py -> build/lib.macosx-10.6-x86_64-2.7/poppy/tests

generating default poppy.cfg file

copying poppy/poppy.cfg -> build/lib.macosx-10.6-x86_64-2.7/poppy

Traceback (most recent call last):

File "", line 1, in

File "/Users/ME/Library/Enthought/Canopy_64bit/User/build/poppy/setup.py", line 144, in

use_2to3=False

File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/core.py", line 152, in setup

dist.run_commands()

File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/dist.py", line 953, in run_commands

self.run_command(cmd)

File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/dist.py", line 972, in run_command

cmd_obj.run()

File "/Users/ME/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/setuptools/command/install.py", line 53, in run

return _install.run(self)

File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/command/install.py", line 563, in run

self.run_command('build')

File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/cmd.py", line 326, in run_command

self.distribution.run_command(command)

File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/dist.py", line 972, in run_command

cmd_obj.run()

File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/command/build.py", line 127, in run

self.run_command(cmd_name)

File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/cmd.py", line 326, in run_command

self.distribution.run_command(command)

File "/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/distutils/dist.py", line 972, in run_command

cmd_obj.run()

File "/Users/ME/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/astropy/setup_helpers.py", line 631, in run

for k, (fnsrc, v) in six.iteritems(self.distribution.command_options['pytest']): KeyError: 'pytest' ---------------------------------------- Cleaning up... Command /Users/ME/Library/Enthought/Canopy_64bit/User/bin/python -c "import setuptools, tokenize;__file__='/Users/ME/Library/Enthought/Canopy_64bit/User/build/poppy/setup.py';exec( compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/-G/-GUFgmQKF2ysFZMLTUvftE+++TI/-Tmp-/pip-CyYl8x-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ME/Library/Enthought/Canopy_64bit/User/include/site/python2.7 failed with error code 1 in /Users/ME/Library/Enthought/Canopy_64bit/User/build/poppy Storing debug log for failure in /Users/ME/.pip/pip.log

1
Not sure if this will help, but you are using an old/early version of Canopy (1.1.0). I suggest that you update to Canopy 1.4.1 first. Either a full re-install (cleanest, see support.enthought.com/entries/23580651-Uninstalling-Canopy) or update from Canopy help menu.Jonathan March

1 Answers

0
votes

There's a custom in Python community to use requirements.txt file for requirements of particular package. Then do pip install -U -r requirements.txt. If that file is not there (in poppy source), you could do simply pip install astropy first to install dependency first.

However, I have to say I have had much better all-around experience with Anaconda Scientific Python distribution than with Canopy. Perhaps you should give it a try.