Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install pyhash fails macOS High Sierra Version 10.13.6 #28

Closed
gregelin opened this issue Sep 2, 2018 · 8 comments
Closed

pip install pyhash fails macOS High Sierra Version 10.13.6 #28

gregelin opened this issue Sep 2, 2018 · 8 comments

Comments

@gregelin
Copy link

gregelin commented Sep 2, 2018

I'm running Python 3.6.4 on macOS High Sierra Version 10.13.6, and pip install pyhash fails with below error. Running Python (Python 2.7.10) and Python3 (Python 3.6.4).

running: pip 18.0 from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip (python 3.6)

sudo pip install pyhash
The directory '/Users/greg/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/greg/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pyhash
  Downloading https://files.pythonhosted.org/packages/55/61/56af3d9ab410b0f73a1a38cf8a93f656ee9937d59c7074a3afa5edbd6008/pyhash-0.9.1.tar.gz (594kB)
    100% |████████████████████████████████| 604kB 4.1MB/s 
Installing collected packages: pyhash
  Running setup.py install for pyhash ... error
    Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-3db3gkrs/pyhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-h3_2plm6/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.6-intel-3.6
    creating build/lib.macosx-10.6-intel-3.6/pyhash
    copying pyhash/__init__.py -> build/lib.macosx-10.6-intel-3.6/pyhash
    Fixing build/lib.macosx-10.6-intel-3.6/pyhash/__init__.py
    Skipping optional fixer: buffer
    Skipping optional fixer: idioms
    Skipping optional fixer: set_literal
    Skipping optional fixer: ws_comma
    Fixing build/lib.macosx-10.6-intel-3.6/pyhash/__init__.py
    Skipping optional fixer: buffer
    Skipping optional fixer: idioms
    Skipping optional fixer: set_literal
    Skipping optional fixer: ws_comma
    running build_clib
    building 'fnv' library
    creating build/temp.macosx-10.6-intel-3.6
    creating build/temp.macosx-10.6-intel-3.6/src
    creating build/temp.macosx-10.6-intel-3.6/src/fnv
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -c src/fnv/hash_32.c -o build/temp.macosx-10.6-intel-3.6/src/fnv/hash_32.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -c src/fnv/hash_32a.c -o build/temp.macosx-10.6-intel-3.6/src/fnv/hash_32a.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -c src/fnv/hash_64.c -o build/temp.macosx-10.6-intel-3.6/src/fnv/hash_64.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -c src/fnv/hash_64a.c -o build/temp.macosx-10.6-intel-3.6/src/fnv/hash_64a.o
    ar rc build/temp.macosx-10.6-intel-3.6/libfnv.a build/temp.macosx-10.6-intel-3.6/src/fnv/hash_32.o build/temp.macosx-10.6-intel-3.6/src/fnv/hash_32a.o build/temp.macosx-10.6-intel-3.6/src/fnv/hash_64.o build/temp.macosx-10.6-intel-3.6/src/fnv/hash_64a.o
    ranlib build/temp.macosx-10.6-intel-3.6/libfnv.a
    building 'smhasher' library
    creating build/temp.macosx-10.6-intel-3.6/src/smhasher
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -c src/smhasher/MurmurHash1.cpp -o build/temp.macosx-10.6-intel-3.6/src/smhasher/MurmurHash1.o -msse4.2 -maes -mavx -mavx2
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -c src/smhasher/MurmurHash2.cpp -o build/temp.macosx-10.6-intel-3.6/src/smhasher/MurmurHash2.o -msse4.2 -maes -mavx -mavx2
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -c src/smhasher/MurmurHash3.cpp -o build/temp.macosx-10.6-intel-3.6/src/smhasher/MurmurHash3.o -msse4.2 -maes -mavx -mavx2
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -c src/smhasher/City.cpp -o build/temp.macosx-10.6-intel-3.6/src/smhasher/City.o -msse4.2 -maes -mavx -mavx2
    src/smhasher/City.cpp:148:21: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
      for (int i = 0; i < len; i++) {
                      ~ ^ ~~~
    1 warning generated.
    src/smhasher/City.cpp:148:21: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
      for (int i = 0; i < len; i++) {
                      ~ ^ ~~~
    1 warning generated.
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -c src/smhasher/Spooky.cpp -o build/temp.macosx-10.6-intel-3.6/src/smhasher/Spooky.o -msse4.2 -maes -mavx -mavx2
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -c src/smhasher/metrohash64.cpp -o build/temp.macosx-10.6-intel-3.6/src/smhasher/metrohash64.o -msse4.2 -maes -mavx -mavx2
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -c src/smhasher/metrohash64crc.cpp -o build/temp.macosx-10.6-intel-3.6/src/smhasher/metrohash64crc.o -msse4.2 -maes -mavx -mavx2
    src/smhasher/metrohash64crc.cpp:52:21: error: use of undeclared identifier '_mm_crc32_u64'
                v[0] ^= _mm_crc32_u64(v[0], read_u64(ptr)); ptr += 8;
                        ^
    src/smhasher/metrohash64crc.cpp:53:21: error: use of undeclared identifier '_mm_crc32_u64'
                v[1] ^= _mm_crc32_u64(v[1], read_u64(ptr)); ptr += 8;
                        ^
    src/smhasher/metrohash64crc.cpp:54:21: error: use of undeclared identifier '_mm_crc32_u64'
                v[2] ^= _mm_crc32_u64(v[2], read_u64(ptr)); ptr += 8;
                        ^
    src/smhasher/metrohash64crc.cpp:55:21: error: use of undeclared identifier '_mm_crc32_u64'
                v[3] ^= _mm_crc32_u64(v[3], read_u64(ptr)); ptr += 8;
                        ^
    src/smhasher/metrohash64crc.cpp:84:17: error: use of undeclared identifier '_mm_crc32_u64'
            hash ^= _mm_crc32_u64(hash, read_u32(ptr)); ptr += 4;
                    ^
    src/smhasher/metrohash64crc.cpp:90:17: error: use of undeclared identifier '_mm_crc32_u64'
            hash ^= _mm_crc32_u64(hash, read_u16(ptr)); ptr += 2;
                    ^
    src/smhasher/metrohash64crc.cpp:96:17: error: use of undeclared identifier '_mm_crc32_u64'
            hash ^= _mm_crc32_u64(hash, read_u8(ptr));
                    ^
    src/smhasher/metrohash64crc.cpp:130:21: error: use of undeclared identifier '_mm_crc32_u64'
                v[0] ^= _mm_crc32_u64(v[0], read_u64(ptr)); ptr += 8;
                        ^
    src/smhasher/metrohash64crc.cpp:131:21: error: use of undeclared identifier '_mm_crc32_u64'
                v[1] ^= _mm_crc32_u64(v[1], read_u64(ptr)); ptr += 8;
                        ^
    src/smhasher/metrohash64crc.cpp:132:21: error: use of undeclared identifier '_mm_crc32_u64'
                v[2] ^= _mm_crc32_u64(v[2], read_u64(ptr)); ptr += 8;
                        ^
    src/smhasher/metrohash64crc.cpp:133:21: error: use of undeclared identifier '_mm_crc32_u64'
                v[3] ^= _mm_crc32_u64(v[3], read_u64(ptr)); ptr += 8;
                        ^
    src/smhasher/metrohash64crc.cpp:162:17: error: use of undeclared identifier '_mm_crc32_u64'
            hash ^= _mm_crc32_u64(hash, read_u32(ptr)); ptr += 4;
                    ^
    src/smhasher/metrohash64crc.cpp:168:17: error: use of undeclared identifier '_mm_crc32_u64'
            hash ^= _mm_crc32_u64(hash, read_u16(ptr)); ptr += 2;
                    ^
    src/smhasher/metrohash64crc.cpp:174:17: error: use of undeclared identifier '_mm_crc32_u64'
            hash ^= _mm_crc32_u64(hash, read_u8(ptr));
                    ^
    14 errors generated.
    error: command '/usr/bin/clang' failed with exit status 1
    
    ----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-3db3gkrs/pyhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-h3_2plm6/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-3db3gkrs/pyhash/
@flier
Copy link
Owner

flier commented Sep 3, 2018

what's your setuptools version? we found similar issue #27 on debian with old setuptools.

$ easy_install --version
setuptools 40.0.0 from /usr/local/lib/python3.7/site-packages (Python 3.7)

@gregelin
Copy link
Author

gregelin commented Sep 3, 2018

I saw the note on the home page and did update my setuptools but had same error afterward. Here are my setuptools version.

$  easy_install --version
setuptools 40.2.0 from /codedata/code/govready-q-asti/env/lib/python3.6/site-packages (Python 3.6)

@flier
Copy link
Owner

flier commented Sep 4, 2018

very strange, it seems your system target be detected as macosx-10.6-intel-3.6, and my laptop always report macosx-10.13-x86_64-3.7.

I found a similar issue capnproto/pycapnp#155, you may try their workaround

$ CFLAGS="-mmacosx-version-min=10.13 -std=c++11 -stdlib=libc++" pip install pyhash

@gregelin
Copy link
Author

gregelin commented Sep 4, 2018

I received a different error:

$ CFLAGS="-mmacosx-version-min=10.13 -std=c++11 -stdlib=libc++" pip install pyhash
Collecting pyhash
  Downloading https://files.pythonhosted.org/packages/55/61/56af3d9ab410b0f73a1a38cf8a93f656ee9937d59c7074a3afa5edbd6008/pyhash-0.9.1.tar.gz (594kB)
    100% |████████████████████████████████| 604kB 1.2MB/s 
Installing collected packages: pyhash
  Running setup.py install for pyhash ... error
    Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/rk/cn5lpv2s2g1cwplxcrdxzj1r0000gn/T/pip-install-kyf95oku/pyhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/rk/cn5lpv2s2g1cwplxcrdxzj1r0000gn/T/pip-record-lk82o1ng/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.6-intel-3.6
    creating build/lib.macosx-10.6-intel-3.6/pyhash
    copying pyhash/__init__.py -> build/lib.macosx-10.6-intel-3.6/pyhash
    Fixing build/lib.macosx-10.6-intel-3.6/pyhash/__init__.py
    Skipping optional fixer: buffer
    Skipping optional fixer: idioms
    Skipping optional fixer: set_literal
    Skipping optional fixer: ws_comma
    Fixing build/lib.macosx-10.6-intel-3.6/pyhash/__init__.py
    Skipping optional fixer: buffer
    Skipping optional fixer: idioms
    Skipping optional fixer: set_literal
    Skipping optional fixer: ws_comma
    running build_clib
    building 'fnv' library
    creating build/temp.macosx-10.6-intel-3.6
    creating build/temp.macosx-10.6-intel-3.6/src
    creating build/temp.macosx-10.6-intel-3.6/src/fnv
    /usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -mmacosx-version-min=10.13 -std=c++11 -stdlib=libc++ -c src/fnv/hash_32.c -o build/temp.macosx-10.6-intel-3.6/src/fnv/hash_32.o
    error: invalid argument '-std=c++11' not allowed with 'C'
    error: command '/usr/bin/clang' failed with exit status 1
    
    ----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/rk/cn5lpv2s2g1cwplxcrdxzj1r0000gn/T/pip-install-kyf95oku/pyhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/rk/cn5lpv2s2g1cwplxcrdxzj1r0000gn/T/pip-record-lk82o1ng/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/rk/cn5lpv2s2g1cwplxcrdxzj1r0000gn/T/pip-install-kyf95oku/pyhash/

@flier
Copy link
Owner

flier commented Sep 5, 2018

please remove it and try again, thanks very much!

$ CFLAGS="-mmacosx-version-min=10.13" pip install pyhash

@gregelin
Copy link
Author

gregelin commented Sep 5, 2018

Well, that seemed to work just fine. Thank you.

Can you please summarize what the command effectively did?

$ sudo CFLAGS="-mmacosx-version-min=10.13" pip install pyhash
Password:
The directory '/Users/greg/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/greg/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pyhash
  Downloading https://files.pythonhosted.org/packages/55/61/56af3d9ab410b0f73a1a38cf8a93f656ee9937d59c7074a3afa5edbd6008/pyhash-0.9.1.tar.gz (594kB)
    100% |████████████████████████████████| 604kB 445kB/s 
Installing collected packages: pyhash
  Running setup.py install for pyhash ... done
Successfully installed pyhash-0.9.1

@flier
Copy link
Owner

flier commented Sep 5, 2018

The root cause is some reason make your Python use macosx-10.6 as default build target, but it's too old and may missed _mm_crc32_u64 function.

So, when we use CFLAGS="-mmacosx-version-min=10.13", we force Python use macosx-10.13 as build target, it works.

I will update the notes for the problem, thanks very much for your feedback.

@flier flier closed this as completed Sep 6, 2018
@gregelin
Copy link
Author

gregelin commented Sep 6, 2018

Thanks for your assistance, @flier!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants