krischer / mtspec

Python library for multitaper spectral estimations
http://krischer.github.io/mtspec/
GNU General Public License v3.0
69 stars 44 forks source link

Install failure -- distutils.unixccompiler #4

Closed abarbour closed 9 years ago

abarbour commented 9 years ago

Error trying to install with Python 2.7.6 ([GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin):

ImportError: cannot import name _darwin_compiler_fixup

I attempted to install with

sudo easy_install mtspec
sudo pip install mtspec

and even

git clone https://github.com/krischer/mtspec
cd mtspec
sudo python setup.py install

all of which fail.

Note there was a similar issue with obspy (https://github.com/obspy/obspy/issues/589) since Python 2.7.4 (https://hg.python.org/cpython/rev/d76b83803e7e)

krischer commented 9 years ago

Heyhey,

I should have fixed that a long time ago. The current master should work again - I also fixed a bunch of other small issues along the way. As an additional bonus you get support for Python 3.3 and 3.4. I'll push to pypi next or week or so, for now cloning the repository should do the trick.

abarbour commented 9 years ago

Hi Lion,

Unfortunately I'm still having problems. After pulling your latest commits, sudo pip install -v -e . claims to install successfully, even though numerous warnings such as this:

ld: warning: ld: warning: ignoring file build/temp.macosx-10.9-x86_64-2.7/mtspec/src/src/sym_fft.o, file was built for i386 which is not the architecture being linked (x86_64): build/temp.macosx-10.9-x86_64-2.7/mtspec/src/src/sym_fft.oignoring file build/temp.macosx-10.9-x86_64-2.7/mtspec/src/src/tinvit.o, file was built for i386 which is not the architecture being linked (x86_64): build/temp.macosx-10.9-x86_64-2.7/mtspec/src/src/tinvit.o

are raised. Afterwards, python -m mtspec.tests gives:

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 151, in _run_module_as_main
    mod_name, loader, code, fname = _get_module_details(mod_name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 101, in _get_module_details
    loader = get_loader(mod_name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 464, in get_loader
    return find_loader(fullname)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 474, in find_loader
    for importer in iter_importers(fullname):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 430, in iter_importers
    __import__(pkg)
  File "mtspec/__init__.py", line 15, in <module>
    from .multitaper import mtspec, sine_psd, dpss  # NOQA
  File "mtspec/multitaper.py", line 624, in <module>
    class _MtspecType(object):
  File "mtspec/multitaper.py", line 629, in _MtspecType
    struct = {"float32": (C.c_float, mtspeclib.mtspec_pad_),
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
    func = self.__getitem__(name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x7fc673595b30, mtspec_pad_): symbol not found

which I'm guessing is associated with the ld linking errors mentioned above.

Any ideas?

krischer commented 9 years ago

Hi Andy,

hmm...this is interesting. I don't understand why it would build some parts for a 32 bit architecture. Can you send me the whole log of the installation after deleting mtspec/build, mtspec/mtspec.egg-info, and mtspec/lib/mtspec.so, if they exist, to ensure the full installation procedure is executed?

It might also be an issue with Fortran/C name mangling and some compiler flags. Can you send me the compiled mtspec/lib/mtspec.so library? Then I can have a look at whats actually in the file.

What Python are you using? A MacPorts one? You might have to make sure you compile mtspec with the same compiler that that Python version was compiled with. It also notoriously difficult to get a fully working gfortran on OSX (although the situation did improve in the last years). I personally have good experiences with the gfortran shipping with Homebrew (in the gcc package).

It installs fine on my machine (OSX 10.10, latest Apple LLVM and clang and gfortran from homebrew; I also use the Python from Anaconda). It also works on Travis for four different Python versions: https://travis-ci.org/krischer/mtspec

abarbour commented 9 years ago

It is most definitely a curious situation. I can replicate what I'm seeing on a different Mac running 10.10 with an Apple-provided build of Python 2.7.6:

sudo -H pip uninstall mtspec
sudo -H rm -fr mtspec/lib/mtspec.so build mtspec.egg-info log.mtspec.install mtspec/*.pyc
sudo -H pip install -v -e . > log.mtspec.install

Some details:

> python --version
Python 2.7.6

> pip --version
pip 6.0.7 from /Library/Python/2.7/site-packages (python 2.7)

> gfortran -v
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /Builds/unix/gcc/gcc-4.2/configure --prefix=/usr/local --mandir=/share/man --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --build=i686-apple-darwin8 --host=i686-apple-darwin8 --target=i686-apple-darwin8 --enable-languages=fortran
Thread model: posix
gcc version 4.2.3

> gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
mbyt commented 9 years ago

For me it looks like you are using a

Are you using python 32bit or 64bit? You can check that via python -c 'import sys;print("%x" % sys.maxsize, sys.maxsize > 2**32)' (True for 64bit).

abarbour commented 9 years ago

Aha, that was it!

Python/C are 64 bit, but gfortran was 32 bit. I installed 64-bit gfortran and mtspec now installs with a few warnings (type-mismatches) but passes tests with python -m mtspec.tests:

..............
----------------------------------------------------------------------
Ran 14 tests in 7.428s

OK

and I can recreate the figure in the tutorial:

tutorial figure

Thanks, Lion -- hopefully I didn't completely waste your time :)

krischer commented 9 years ago

@mbyt thanks for the clarification

@abarbour 443bb98a8d289839d449f5bea5d3b8defcd42798 now forces gfortran to compile for the same architecture that the Python interpreter has been compiled with. It will still try to link against the wrong libgfortran and print the warning you saw above. I would like to make it actually stop the linking but could not get it to work. In any case I hope somebody looking for help might find this thread and thus have a solution.

The type mismatch warnings during installation should not be the biggest problem. I also have them but was too lazy to fix them so far.

If the tests work you should be good to go :-) They are fairly comprehensive.

Where did you get that gfortran from in the first place? That's incredibly old, the most recent version is 4.9, e.g. on my system

$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/4.9.2_1/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/lto-wrapper
Target: x86_64-apple-darwin14.0.0
Configured with: ../configure --build=x86_64-apple-darwin14.0.0 --prefix=/usr/local/Cellar/gcc/4.9.2_1 --libdir=/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-4.9 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog --with-isl=/usr/local/opt/isl --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc 4.9.2_1' --with-bugurl=https://github.com/Homebrew/homebrew/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.9.2 (Homebrew gcc 4.9.2_1)

The Apple gcc is only on 4.2 as 4.3 started using the GPLv3 which Apple disliked. But on modern OSX system the compiler is actually clang/llvm just with a gfortran frontend so the actual C compiler is usually quite modern.

abarbour commented 9 years ago

@krischer I use R extensively, so I'm guessing their build of 4.2.3 (http://cran.rstudio.com/bin/macosx/tools/) installed over the OSX systems' build. How things worked targeting 32-bit architecture is beyond me.

nukolas commented 8 years ago

Hello,

I am getting the same ImportError (Import Error: cannot import name _darwin_compiler_fixup) when trying to install mtspec using pip on Linux:

pip install mtspec
Collecting mtspec
  Using cached mtspec-0.2.6.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-no_DyI/mtspec/setup.py", line 47, in <module>
        from distutils.unixccompiler import UnixCCompiler, _darwin_compiler_fixup
    ImportError: cannot import name _darwin_compiler_fixup

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-no_DyI/mtspec

Some details as per previous posts in this thread:

python --version
Python 2.7.11 :: Anaconda 2.4.1 (64-bit)

pip --version
pip 7.1.2 from /home/nick/anaconda2/lib/python2.7/site-packages (python 2.7)

gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ...... (# I have cut the contents of this line to reduce complexity - not sure if they are important?)
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) 

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ....... (# comment as for previous)
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) 

Any ideas how to get this working? I'm not sure what the _darwin_compiler_fixup is, but seems to be related to the mac install procedure as per previous posts?

krischer commented 8 years ago

@nukolas It should work if you install from the latest repository version.

I intended to upload the change to pypi but we temporarily lost control of our account there. We regained it but I forgot to update it. Will do so soon.

nukolas commented 8 years ago

Thanks @krischer , installing from the git repo worked, all tests passed.

vedadhg commented 8 years ago

Hi @krischer,

I don't know if you are still maintaining the package. I have tried to install it and the message I get when I run the test is

Traceback (most recent call last): File "/home/vedadh/Software/anaconda2/lib/python2.7/runpy.py", line 151, in _run_module_as_main mod_name, loader, code, fname = _get_module_details(mod_name) File "/home/vedadh/Software/anaconda2/lib/python2.7/runpy.py", line 101, in _get_module_details loader = get_loader(mod_name) File "/home/vedadh/Software/anaconda2/lib/python2.7/pkgutil.py", line 464, in get_loader return find_loader(fullname) File "/home/vedadh/Software/anaconda2/lib/python2.7/pkgutil.py", line 474, in find_loader for importer in iter_importers(fullname): File "/home/vedadh/Software/anaconda2/lib/python2.7/pkgutil.py", line 430, in iter_importers import(pkg) File "mtspec/init.py", line 15, in from .multitaper import mtspec, sine_psd, dpss # NOQA File "mtspec/multitaper.py", line 19, in mtspeclib = _load_lib() File "mtspec/util.py", line 35, in _load_lib raise ValueError("Could not find suitable instaseis shared " ValueError: Could not find suitable instaseis shared library.

I have installed instaseis. Still, I get this message. Any help? Thanks!

krischer commented 8 years ago

Hi @vedadhg: I'm maintaining it a bit and try to make sure it keeps working. Did you install it from github? If yes: how and can you send me the installation log?

vedadhg commented 8 years ago

Hi and thanks for quick response! First I tried installing using pip. Didn't work. Then, I tried the recipe from the this comment side

git clone https://github.com/krischer/mtspec
cd mtspec
sudo python setup.py install

Where can I find the installation log?

krischer commented 8 years ago

I just need the output of sudo python setup.py install.

A side note: In general I would advise to never use sudo to install Python packages as it might mess with the system installation. I would use pip install --user . in the folder or even better: download anaconda and install everything locally with anaconda.

vedadhg commented 8 years ago

I have just installed anaconda. I you drop me a line on how to do it with conda, I'll give it a try. In the mean time, I have rerun the python setup.py install and here is the result:

running install
running bdist_egg
running egg_info
writing requirements to mtspec.egg-info/requires.txt
writing mtspec.egg-info/PKG-INFO
writing top-level names to mtspec.egg-info/top_level.txt
writing dependency_links to mtspec.egg-info/dependency_links.txt
reading manifest file 'mtspec.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'mtspec/src/data/*'
no previously-included directories found matching 'mtspec/src/developing/*'
no previously-included directories found matching 'mtspec/src/doc/*'
no previously-included directories found matching 'mtspec/src/examples/*'
no previously-included directories found matching 'mtspec/src/license/*'
no previously-included directories found matching 'mtspec/src/Makefile'
no previously-included directories found matching 'mtspec/src/makefiles/*'
no previously-included directories found matching 'mtspec/src/Makefile.win'
no previously-included directories found matching 'mtspec/src/matlab/*'
no previously-included directories found matching 'mtspec/src/plot/*'
no previously-included directories found matching 'mtspec/src/programs/*'
no previously-included directories found matching 'mtspec/src/README'
writing manifest file 'mtspec.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/mtspec
creating build/bdist.linux-x86_64/egg/mtspec/tests
creating build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/data/dpss.npz -> build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/data/single_taper.npz -> build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/data/quadratic_multitaper.npz -> build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/data/mt_cohe.npz -> build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/data/v22_174_series.dat.gz -> build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/data/PASC.dat.gz -> build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/data/fstatistics.npz -> build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/data/mtspec_pad_with_errors.npz -> build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/data/wv.npz -> build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/data/multitaper.npz -> build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/data/sine_psd.npz -> build/bdist.linux-x86_64/egg/mtspec/tests/data
copying build/lib.linux-x86_64-2.7/mtspec/tests/test_code_formatting.py -> build/bdist.linux-x86_64/egg/mtspec/tests
copying build/lib.linux-x86_64-2.7/mtspec/tests/test_recreatepaperfigures.py -> build/bdist.linux-x86_64/egg/mtspec/tests
copying build/lib.linux-x86_64-2.7/mtspec/tests/__init__.py -> build/bdist.linux-x86_64/egg/mtspec/tests
copying build/lib.linux-x86_64-2.7/mtspec/tests/__main__.py -> build/bdist.linux-x86_64/egg/mtspec/tests
copying build/lib.linux-x86_64-2.7/mtspec/tests/test_multitaper.py -> build/bdist.linux-x86_64/egg/mtspec/tests
copying build/lib.linux-x86_64-2.7/mtspec/VERSION.txt -> build/bdist.linux-x86_64/egg/mtspec
copying build/lib.linux-x86_64-2.7/mtspec/multitaper.py -> build/bdist.linux-x86_64/egg/mtspec
creating build/bdist.linux-x86_64/egg/mtspec/lib
copying build/lib.linux-x86_64-2.7/mtspec/lib/mtspec.so -> build/bdist.linux-x86_64/egg/mtspec/lib
copying build/lib.linux-x86_64-2.7/mtspec/__init__.py -> build/bdist.linux-x86_64/egg/mtspec
copying build/lib.linux-x86_64-2.7/mtspec/util.py -> build/bdist.linux-x86_64/egg/mtspec
creating build/bdist.linux-x86_64/egg/mtspec/src
creating build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/set_xint.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/mt_cohe.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/eigenft.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/atanh2.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/qtdis.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/rsm_eig.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/mt_deconv.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/nnls.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/jackspec.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/tinvit.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/fdis.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/dpss_spline.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/spline.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/adaptspec.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/zqrfac.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/tridib.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/pythag.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/qrfac.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/trbak1.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/nsqi.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/fft.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/mt_transfer.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/sft.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/tred1.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/qiinv.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/sine_cohe.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/psd_reshape.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/sym_fft.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/xint.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/ifft.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/mtspec.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/spectra.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/sine_psd.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/nearn.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/df_spec.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/dpss.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/nsinv.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/oct_spec.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/ftest.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/wv_spec.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/qsnorm.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/dpss_ev.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/.DS_Store -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/yule.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
copying build/lib.linux-x86_64-2.7/mtspec/src/src/wv_spec_to_array.f90 -> build/bdist.linux-x86_64/egg/mtspec/src/src
byte-compiling build/bdist.linux-x86_64/egg/mtspec/tests/test_code_formatting.py to test_code_formatting.pyc
byte-compiling build/bdist.linux-x86_64/egg/mtspec/tests/test_recreatepaperfigures.py to test_recreatepaperfigures.pyc
byte-compiling build/bdist.linux-x86_64/egg/mtspec/tests/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/mtspec/tests/__main__.py to __main__.pyc
byte-compiling build/bdist.linux-x86_64/egg/mtspec/tests/test_multitaper.py to test_multitaper.pyc
byte-compiling build/bdist.linux-x86_64/egg/mtspec/multitaper.py to multitaper.pyc
byte-compiling build/bdist.linux-x86_64/egg/mtspec/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/mtspec/util.py to util.pyc
creating stub loader for mtspec/lib/mtspec.so
byte-compiling build/bdist.linux-x86_64/egg/mtspec/lib/mtspec.py to mtspec.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying mtspec.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying mtspec.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying mtspec.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying mtspec.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
copying mtspec.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying mtspec.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
creating 'dist/mtspec-0.3.x-py2.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing mtspec-0.3.x-py2.7-linux-x86_64.egg
removing '/usr/local/lib/python2.7/dist-packages/mtspec-0.3.x-py2.7-linux-x86_64.egg' (and everything under it)
creating /usr/local/lib/python2.7/dist-packages/mtspec-0.3.x-py2.7-linux-x86_64.egg
Extracting mtspec-0.3.x-py2.7-linux-x86_64.egg to /usr/local/lib/python2.7/dist-packages
mtspec 0.3.x is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/mtspec-0.3.x-py2.7-linux-x86_64.egg
Processing dependencies for mtspec==0.3.x
Searching for numpy==1.8.2
Best match: numpy 1.8.2
numpy 1.8.2 is already the active version in easy-install.pth

Using /usr/lib/python2.7/dist-packages
Finished processing dependencies for mtspec==0.3.x
krischer commented 8 years ago

To install with anaconda:

pip install . (In the folder of the mtspec git repository)

Regarding your other problem: I'm not entirely sure whats going on. The compiled library should be at /usr/local/lib/python2.7/dist-packages/mtspec/lib/mtspec.so (can you check?). If so - I suspect you somehow have one or more mtspec installations. To fix that get rid of the existing one with:

pip uninstall mtspec
# Also remove all references of mtspec in /usr/local/lib/python2.7/dist-packages (also check in the the *.pth) files.

And then install again with pip install .. I'm fairly certain the installation routine is correct and I think the error is with your installation (but who knows).

vedadhg commented 8 years ago

I am sure the error is on my side. When the first install did not go through cleanly, I tried many different things and probably messed up stuff.

When I tried uninstalling using pip, it says the package is not installed. If I try installing using pip install ., I get

.../Wavelet/mtspec$ pip install . Processing ...Wavelet/mtspec Requirement already satisfied (use --upgrade to upgrade): mtspec===0.3.x from file:///.../Wavelet/mtspec in .../Wavelet/mtspec Requirement already satisfied (use --upgrade to upgrade): numpy in .../anaconda2/lib/python2.7/site-packages (from mtspec===0.3.x)

krischer commented 8 years ago

Hmm...something is a bit messed up I think - try a manual uninstallation: Go in your site-packages directory and delete all references to mtspec - also look into the *.pth files and delete all lines containing mtspec.

To find the site-packages directories:

python -c "import site; print(site.getsitepackages())"

Also do you have the PYTHONPATH environment variable set? That is always a bit dangerous.

Next thing to check if python and pip are for the same python installations - just do

which pip
which python

and the executables should be located in the same directory.

If that is all good: try to import mtspec in python and it should fail - the uninstallation was thus successful. Try installing again. I hope it then works.

vedadhg commented 8 years ago

In [3]: mtspec. mtspec.dpss mtspec.mtspec mtspec.sine_psd mtspec.wigner_ville_spectrum mtspec.mt_coherence mtspec.multitaper mtspec.util As you can see, it worked in the end. Thanks a lot!