mckib2 / pygrappa

Python implementations of GRAPPA-like algorithms.
https://pygrappa.readthedocs.io/en/latest/
MIT License
64 stars 13 forks source link

pip installation fails in Mac #69

Closed kingaza closed 4 years ago

kingaza commented 4 years ago

env: macOS 1015.4 acOSX.sdk/usr/include/c++/4.2.1 Apple clang version 11.0.3 (clang-1103.0.32.59) Target: x86_64-apple-darwin19.4.0

(base) abu:~ abu$ pip install pygrappa Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting pygrappa Using cached https://pypi.tuna.tsinghua.edu.cn/packages/5c/c2/fd4532079321ae7cc88f8cf5fc96a96b00f918b162d803011d8f83e017c4/pygrappa-0.21.1.tar.gz ERROR: Complete output from command python setup.py egg_info: ERROR: Traceback (most recent call last): File "", line 1, in File "/private/var/folders/my/s_lbvtcn6nb3mylc5cvtp0240000gn/T/pip-install-xg7ghxo8/pygrappa/setup.py", line 8, in from setup_helpers import get_build_ext_override ModuleNotFoundError: No module named 'setup_helpers'

ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/my/s_lbvtcn6nb3mylc5cvtp0240000gn/T/pip-install-xg7ghxo8/pygrappa/

mckib2 commented 4 years ago

This is due to aftermath of #61. setup_helpers.py is missing from MANIFEST.in and so is not uploaded to pypi. Should be a quick fix

mckib2 commented 4 years ago

Fix has been uploaded to pypi, try installing again via pip (may have to ignore cache to get latest version, i.e. pip install pygrappa --no-cache-dir).

There are CI tests on the git repo, but some files are not automatically included in PyPI distribution, so please let me know if you find anything else that is missing or breaks. I work primarily on Linux and don't have easy access to Mac

kingaza commented 4 years ago

such a quick reply! thx very much~

and installation from source also fails. is it the same problem?

(base) abu:pygrappa abu$ python setup.py install Running cython... Warning: 'keywords' should be a list, got type 'tuple' running install running bdist_egg running egg_info running build_src build_src building extension "pygrappa.cgrappa" sources building extension "pygrappa.grog_powers" sources building extension "pygrappa.grog_gridding" sources build_src: building npy-pkg config files writing pygrappa.egg-info/PKG-INFO writing dependency_links to pygrappa.egg-info/dependency_links.txt writing requirements to pygrappa.egg-info/requires.txt writing top-level names to pygrappa.egg-info/top_level.txt reading manifest file 'pygrappa.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'pygrappa.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.7-x86_64/egg running install_lib running build_py running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext customize UnixCCompiler customize UnixCCompiler using build_ext building 'pygrappa.cgrappa' extension compiling C++ sources C compiler: g++ -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/abu/anaconda3/include -arch x86_64 -I/Users/abu/anaconda3/include -arch x86_64

compile options: '-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -I./src/ -I/Users/abu/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/Users/abu/anaconda3/include/python3.7m -c' g++: ./src/cgrappa.cpp g++ -bundle -undefined dynamic_lookup -L/Users/abu/anaconda3/lib -arch x86_64 -L/Users/abu/anaconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.7/src/cgrappa.o build/temp.macosx-10.7-x86_64-3.7/src/get_sampling_patterns.o -o build/lib.macosx-10.7-x86_64-3.7/pygrappa/cgrappa.cpython-37m-darwin.so Traceback (most recent call last): File "setup.py", line 90, in configuration(top_path='').todict(), File "/Users/abu/anaconda3/lib/python3.7/site-packages/numpy/distutils/core.py", line 171, in setup return old_setup(new_attr) File "/Users/abu/anaconda3/lib/python3.7/site-packages/setuptools/init.py", line 145, in setup return distutils.core.setup(*attrs) File "/Users/abu/anaconda3/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/Users/abu/anaconda3/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/Users/abu/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/abu/anaconda3/lib/python3.7/site-packages/numpy/distutils/command/install.py", line 62, in run r = self.setuptools_run() File "/Users/abu/anaconda3/lib/python3.7/site-packages/numpy/distutils/command/install.py", line 56, in setuptools_run self.do_egg_install() File "/Users/abu/anaconda3/lib/python3.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/Users/abu/anaconda3/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Users/abu/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/abu/anaconda3/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 172, in run cmd = self.call_command('install_lib', warn_dir=0) File "/Users/abu/anaconda3/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 158, in call_command self.run_command(cmdname) File "/Users/abu/anaconda3/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Users/abu/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/abu/anaconda3/lib/python3.7/site-packages/setuptools/command/install_lib.py", line 11, in run self.build() File "/Users/abu/anaconda3/lib/python3.7/distutils/command/install_lib.py", line 107, in build self.run_command('build_ext') File "/Users/abu/anaconda3/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/Users/abu/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Users/abu/anaconda3/lib/python3.7/site-packages/numpy/distutils/command/build_ext.py", line 261, in run self.build_extensions() File "/Users/abu/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions self._build_extensions_serial() File "/Users/abu/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial self.build_extension(ext) File "/Users/abu/02_Dev/pygrappa/setup_helpers.py", line 47, in build_extension _run_pre_build_hooks(hooks, (self, ext)) File "/Users/abu/02_Dev/pygrappa/setup_helpers.py", line 83, in _run_pre_build_hooks hook(args) File "setup.py", line 14, in pre_build_hook from scipy._build_utils.compiler_helper import get_cxx_std_flag ModuleNotFoundError: No module named 'scipy._build_utils.compiler_helper'

mckib2 commented 4 years ago

Yep, this looks like it might be a chicken/egg dependency problem. Do you have scipy installed currently in your environment? If not, try installing scipy first (i.e., pip install scipy), then install pygrappa

kingaza commented 4 years ago

yes, I have installed scipy-1.3.0 already.

pip installation failed again. is the latest version 0.21.3?

Collecting pygrappa Downloading https://files.pythonhosted.org/packages/ca/ef/0a0e2ff4084e3fd42715201d2e00fcd92c6f4c1f7e7f91c47d920b338a81/pygrappa-0.21.3.tar.gz (432kB) |████████████████████████████████| 440kB 22kB/s ERROR: Complete output from command python setup.py egg_info: ERROR: Traceback (most recent call last): File "", line 1, in File "/private/var/folders/my/s_lbvtcn6nb3mylc5cvtp0240000gn/T/pip-install-uljz74s4/pygrappa/setup.py", line 86, in install_requires=open('requirements.txt').read().split(), FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/my/s_lbvtcn6nb3mylc5cvtp0240000gn/T/pip-install-uljz74s4/pygrappa/

mckib2 commented 4 years ago

FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

Another missing entry from MANIFEST.in... I'll add that file in and we can give it another go.

yes, I have installed scipy-1.3.0 already.

Most recent should be scipy-1.4.1 -- can you try upgrading? (i.e., pip install --upgrade scipy). There have been some recent changes to their build system that I am trying take advantage of and I don't know if those are present in scipy 1.3.*.

mckib2 commented 4 years ago

Latest pygrappa-0.21.5 should now be available including the missing file

kingaza commented 4 years ago

great, 0.21.5 works! thx a lot~