当前位置:   article > 正文

mac安装pymssql遇见的问题_mac raise calledprocesserror(retcode, cmd)

mac raise calledprocesserror(retcode, cmd)

mac安装pymssql可以直接在终端运行: pip install pymssql

  1. Jason-MacBook-Pro:~ wangying$ pip install pymssql
  2. Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
  3. Collecting pymssql
  4. Downloading http://mirrors.aliyun.com/pypi/packages/2e/81/99562b93d75f3fc5956fa65decfb35b38a4ee97cf93c1d0d3cb799fffb99/pymssql-2.1.4.tar.gz (691 kB)
  5. |████████████████████████████████| 691 kB 3.9 MB/s
  6. ERROR: Command errored out with exit status 1:
  7. command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-4ndcppo8/pymssql/setup.py'"'"'; __file__='"'"'/private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-4ndcppo8/pymssql/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-pip-egg-info-djzidp6h
  8. cwd: /private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-4ndcppo8/pymssql/
  9. Complete output (7 lines):
  10. /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py:45: DistDeprecationWarning: Do not call this function
  11. warnings.warn("Do not call this function", DistDeprecationWarning)
  12. Traceback (most recent call last):
  13. File "<string>", line 1, in <module>
  14. File "/private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-4ndcppo8/pymssql/setup.py", line 88, in <module>
  15. from Cython.Distutils import build_ext as _build_ext
  16. ModuleNotFoundError: No module named 'Cython'
  17. ----------------------------------------
  18. ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

这里要注意错误提示在这里:ModuleNotFoundError: No module named 'Cython'

意思是缺少:Cython 库

  1. Jason-MacBook-Pro:~ wangying$ pip install cython
  2. Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
  3. Collecting cython
  4. Downloading http://mirrors.aliyun.com/pypi/packages/a4/87/d7431a94c7c438af66a91d63089be82cf0a5cb924fe2f74197c539f03568/Cython-0.29.20-cp37-cp37m-macosx_10_9_x86_64.whl (1.9 MB)
  5. |████████████████████████████████| 1.9 MB 3.4 MB/s
  6. Installing collected packages: cython
  7. Successfully installed cython-0.29.20

接下来再次尝试:pip install pymssql

  1. Jason-MacBook-Pro:~ wangying$ pip install pymssql
  2. Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
  3. Collecting pymssql
  4. Downloading http://mirrors.aliyun.com/pypi/packages/2e/81/99562b93d75f3fc5956fa65decfb35b38a4ee97cf93c1d0d3cb799fffb99/pymssql-2.1.4.tar.gz (691 kB)
  5. |████████████████████████████████| 691 kB 2.6 MB/s
  6. ERROR: Command errored out with exit status 1:
  7. command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-jugml9po/pymssql/setup.py'"'"'; __file__='"'"'/private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-jugml9po/pymssql/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-pip-egg-info-uu2axsnf
  8. cwd: /private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-jugml9po/pymssql/
  9. Complete output (53 lines):
  10. WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.
  11. ERROR: Could not find a version that satisfies the requirement setuptools_git (from versions: none)
  12. ERROR: No matching distribution found for setuptools_git
  13. /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py:44: DistDeprecationWarning: Do not call this function
  14. warnings.warn("Do not call this function", DistDeprecationWarning)
  15. Traceback (most recent call last):
  16. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
  17. subprocess.check_call(cmd)
  18. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 363, in check_call
  19. raise CalledProcessError(retcode, cmd)
  20. subprocess.CalledProcessError: Command '['/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/tmprqncvacr', '--quiet', 'setuptools_git']' returned non-zero exit status 1.
  21. During handling of the above exception, another exception occurred:
  22. Traceback (most recent call last):
  23. File "<string>", line 1, in <module>
  24. File "/private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-jugml9po/pymssql/setup.py", line 482, in <module>
  25. ext_modules = ext_modules(),
  26. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 163, in setup
  27. _install_setup_requires(attrs)
  28. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 158, in _install_setup_requires
  29. dist.fetch_build_eggs(dist.setup_requires)
  30. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 698, in fetch_build_eggs
  31. replace_conflicting=True,
  32. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
  33. replace_conflicting=replace_conflicting
  34. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
  35. return self.obtain(req, installer)
  36. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
  37. return installer(requirement)
  38. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 754, in fetch_build_egg
  39. return fetch_build_egg(self, req)
  40. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/installer.py", line 130, in fetch_build_egg
  41. raise DistutilsError(str(e))
  42. distutils.errors.DistutilsError: Command '['/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/tmprqncvacr', '--quiet', 'setuptools_git']' returned non-zero exit status 1.
  43. setup.py: platform.system() => 'Darwin'
  44. setup.py: platform.architecture() => ('64bit', '')
  45. setup.py: platform.libc_ver() => ('', '')
  46. setup.py: Detected Darwin/Mac OS X.
  47. You can install FreeTDS with Homebrew or MacPorts, or by downloading
  48. and compiling it yourself.
  49. Homebrew (http://brew.sh/)
  50. --------------------------
  51. brew install freetds
  52. MacPorts (http://www.macports.org/)
  53. -----------------------------------
  54. sudo port install freetds
  55. setup.py: Not using bundled FreeTDS
  56. setup.py: include_dirs = ['/usr/local/include']
  57. setup.py: library_dirs = ['/usr/local/lib']
  58. ----------------------------------------
  59. ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

这里需要注意,别人有提示:

  1. You can install FreeTDS with Homebrew or MacPorts, or by downloading
  2. and compiling it yourself.
  3. Homebrew (http://brew.sh/)
  4. --------------------------
  5. brew install freetds
  6. MacPorts (http://www.macports.org/)
  7. -----------------------------------
  8. sudo port install freetds

还需安装FreeTDS库,接下继续安装:

  1. Jason-MacBook-Pro:~ wangying$ brew install freetds
  2. Error: Another active Homebrew update process is already in progress.
  3. Please wait for it to finish or terminate it to continue.
  4. ==> Downloading https://homebrew.bintray.com/bottles/libtool-2.4.6_2.high_sierra
  5. ==> Downloading from https://akamai.bintray.com/60/60c7d86f9364e166846f8d3fb2ba9
  6. ######################################################################## 100.0%
  7. ==> Downloading https://homebrew.bintray.com/bottles/unixodbc-2.3.7.high_sierra.
  8. ==> Downloading from https://akamai.bintray.com/0b/0b30b166c0e6bbd9df375a018d0f2
  9. ######################################################################## 100.0%
  10. ==> Downloading https://homebrew.bintray.com/bottles/freetds-1.1.42.high_sierra.
  11. ==> Downloading from https://akamai.bintray.com/bd/bd498b68beba699326bb17fb2e4c5
  12. ######################################################################## 100.0%
  13. ==> Installing dependencies for freetds: libtool and unixodbc
  14. ==> Installing freetds dependency: libtool
  15. ==> Pouring libtool-2.4.6_2.high_sierra.bottle.tar.gz
  16. ==> Caveats
  17. In order to prevent conflicts with Apple's own libtool we have prepended a "g"
  18. so, you have instead: glibtool and glibtoolize.
  19. ==> Summary
  20. 声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/218780
    推荐阅读
    相关标签