|
| 1 | +# Common errors when installing the environment |
| 2 | + |
| 3 | +Here we describe the common errors reported and how to fix them. |
| 4 | + |
| 5 | +## Operational System - MAC OS |
| 6 | + |
| 7 | +### Error Message: |
| 8 | + |
| 9 | +error: command 'clang' failed with exit status 1 |
| 10 | + |
| 11 | +``` |
| 12 | +Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in ./.venv/lib/python3.7/site-packages (from stevedore->doc8==0.8.1->-r requirements-dev.txt (line 7)) (5.5.1) |
| 13 | +Using legacy 'setup.py install' for python-Levenshtein, since package 'wheel' is not installed. |
| 14 | +Installing collected packages: awswrangler, python-Levenshtein |
| 15 | + Attempting uninstall: awswrangler |
| 16 | + Found existing installation: awswrangler 2.4.0 |
| 17 | + Uninstalling awswrangler-2.4.0: |
| 18 | + Successfully uninstalled awswrangler-2.4.0 |
| 19 | + Running setup.py develop for awswrangler |
| 20 | + Running setup.py install for python-Levenshtein ... error |
| 21 | + ERROR: Command errored out with exit status 1: |
| 22 | + command: /Users/$USER/Projects/aws-data-wrangler/.venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/f5/6dztqmhd6tb0mlxyzg2w32xdrmsqz_/T/pip-install-eobnhvyq/python-levenshtein_3ce6f911c6454215835eb21e204f9564/setup.py'"'"'; __file__='"'"'/private/var/folders/f5/6dztqmhd6tb0mlxyzg2w32xdrmsqz_/T/pip-install-eobnhvyq/python-levenshtein_3ce6f911c6454215835eb21e204f9564/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/f5/6dztqmhd6tb0mlxyzg2w32xdrmsqz_/T/pip-record-mh08s0za/install-record.txt --single-version-externally-managed --compile --install-headers /Users/$USER/Projects/aws-data-wrangler/.venv/include/site/python3.7/python-Levenshtein |
| 23 | + cwd: /private/var/folders/f5/6dztqmhd6tb0mlxyzg2w32xdrmsqz_/T/pip-install-eobnhvyq/python-levenshtein_3ce6f911c6454215835eb21e204f9564/ |
| 24 | + Complete output (31 lines): |
| 25 | + running install |
| 26 | + running build |
| 27 | + running build_py |
| 28 | + creating build |
| 29 | + creating build/lib.macosx-10.13-x86_64-3.7 |
| 30 | + creating build/lib.macosx-10.13-x86_64-3.7/Levenshtein |
| 31 | + copying Levenshtein/StringMatcher.py -> build/lib.macosx-10.13-x86_64-3.7/Levenshtein |
| 32 | + copying Levenshtein/__init__.py -> build/lib.macosx-10.13-x86_64-3.7/Levenshtein |
| 33 | + running egg_info |
| 34 | + writing python_Levenshtein.egg-info/PKG-INFO |
| 35 | + writing dependency_links to python_Levenshtein.egg-info/dependency_links.txt |
| 36 | + writing entry points to python_Levenshtein.egg-info/entry_points.txt |
| 37 | + writing namespace_packages to python_Levenshtein.egg-info/namespace_packages.txt |
| 38 | + writing requirements to python_Levenshtein.egg-info/requires.txt |
| 39 | + writing top-level names to python_Levenshtein.egg-info/top_level.txt |
| 40 | + reading manifest file 'python_Levenshtein.egg-info/SOURCES.txt' |
| 41 | + reading manifest template 'MANIFEST.in' |
| 42 | + warning: no previously-included files matching '*pyc' found anywhere in distribution |
| 43 | + warning: no previously-included files matching '*so' found anywhere in distribution |
| 44 | + warning: no previously-included files matching '.project' found anywhere in distribution |
| 45 | + warning: no previously-included files matching '.pydevproject' found anywhere in distribution |
| 46 | + writing manifest file 'python_Levenshtein.egg-info/SOURCES.txt' |
| 47 | + copying Levenshtein/_levenshtein.c -> build/lib.macosx-10.13-x86_64-3.7/Levenshtein |
| 48 | + copying Levenshtein/_levenshtein.h -> build/lib.macosx-10.13-x86_64-3.7/Levenshtein |
| 49 | + running build_ext |
| 50 | + building 'Levenshtein._levenshtein' extension |
| 51 | + creating build/temp.macosx-10.13-x86_64-3.7 |
| 52 | + creating build/temp.macosx-10.13-x86_64-3.7/Levenshtein |
| 53 | + clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/Users/$USER/Projects/aws-data-wrangler/.venv/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c Levenshtein/_levenshtein.c -o build/temp.macosx-10.13-x86_64-3.7/Levenshtein/_levenshtein.o |
| 54 | + xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun |
| 55 | + error: command 'clang' failed with exit status 1 |
| 56 | + ---------------------------------------- |
| 57 | +ERROR: Command errored out with exit status 1: /Users/$USER/Projects/aws-data-wrangler/.venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/f5/6dztqmhd6tb0mlxyzg2w32xdrmsqz_/T/pip-install-eobnhvyq/python-levenshtein_3ce6f911c6454215835eb21e204f9564/setup.py'"'"'; __file__='"'"'/private/var/folders/f5/6dztqmhd6tb0mlxyzg2w32xdrmsqz_/T/pip-install-eobnhvyq/python-levenshtein_3ce6f911c6454215835eb21e204f9564/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/f5/6dztqmhd6tb0mlxyzg2w32xdrmsqz_/T/pip-record-mh08s0za/install-record.txt --single-version-externally-managed --compile --install-headers /Users/$USER/Projects/aws-data-wrangler/.venv/include/site/python3.7/python-Levenshtein Check the logs for full command output. |
| 58 | +(.venv) ~/Projects/aws-data-wrangler> pip list |
| 59 | +``` |
| 60 | + |
| 61 | +### Solution |
| 62 | + |
| 63 | +https://stackoverflow.com/questions/64618257/pip-install-in-a-mac |
| 64 | + |
| 65 | +``` |
| 66 | +xcode-select --install |
| 67 | +``` |
| 68 | + |
| 69 | +----- |
| 70 | + |
| 71 | +### Error Message: |
| 72 | + |
| 73 | +ImportError: dlopen(/Users/$USER/Projects/aws-data-wrangler/.venv/lib/python3.7/site-packages/pyodbc.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/unixodbc/lib/libodbc.2.dylib |
| 74 | + |
| 75 | + |
| 76 | +``` |
| 77 | +ImportError while loading conftest '/Users/$USER/Projects/aws-data-wrangler/tests/conftest.py'. |
| 78 | +tests/conftest.py:6: in <module> |
| 79 | + import awswrangler as wr |
| 80 | +awswrangler/__init__.py:10: in <module> |
| 81 | + from awswrangler import ( # noqa |
| 82 | +awswrangler/sqlserver.py:20: in <module> |
| 83 | + import pyodbc # pylint: disable=import-error |
| 84 | +E ImportError: dlopen(/Users/$USER/Projects/aws-data-wrangler/.venv/lib/python3.7/site-packages/pyodbc.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/unixodbc/lib/libodbc.2.dylib |
| 85 | +E Referenced from: /Users/$USER/Projects/aws-data-wrangler/.venv/lib/python3.7/site-packages/pyodbc.cpython-37m-darwin.so |
| 86 | +E Reason: image not found |
| 87 | +(.venv) ~/Projects/aws-data-wrangler> python |
| 88 | +Python 3.7.7 (default, Mar 10 2020, 15:43:27) |
| 89 | +[Clang 10.0.0 (clang-1000.11.45.5)] on darwin |
| 90 | +Type "help", "copyright", "credits" or "license" for more information. |
| 91 | +>>> import awswrangler |
| 92 | +Traceback (most recent call last): |
| 93 | + File "<stdin>", line 1, in <module> |
| 94 | + File "/Users/$USER/Projects/aws-data-wrangler/awswrangler/__init__.py", line 10, in <module> |
| 95 | + from awswrangler import ( # noqa |
| 96 | + File "/Users/$USER/Projects/aws-data-wrangler/awswrangler/sqlserver.py", line 20, in <module> |
| 97 | + import pyodbc # pylint: disable=import-error |
| 98 | +ImportError: dlopen(/Users/$USER/Projects/aws-data-wrangler/.venv/lib/python3.7/site-packages/pyodbc.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/unixodbc/lib/libodbc.2.dylib |
| 99 | + Referenced from: /Users/$USER/Projects/aws-data-wrangler/.venv/lib/python3.7/site-packages/pyodbc.cpython-37m-darwin.so |
| 100 | + Reason: image not found |
| 101 | +>>> |
| 102 | +KeyboardInterrupt |
| 103 | +``` |
| 104 | + |
| 105 | +### Solution |
| 106 | + |
| 107 | +https://stackoverflow.com/questions/54302793/dyld-library-not-loaded-usr-local-opt-unixodbc-lib-libodbc-2-dylib |
| 108 | + |
| 109 | +``` |
| 110 | +brew install unixodbc |
| 111 | +``` |
| 112 | + |
| 113 | +----- |
0 commit comments