mac安装pymssql遇见的问题

mac安装pymssql遇见的问题mac安装pymssql可以直接在终端运行:pipinstallpymssqlJason-MacBook-Pro:~wangying$pipinstallpymssqlLookinginindexes:http://mirrors.aliyun.com/pypi/simple/CollectingpymssqlDownloadinghttp://mirrors.aliyun.com/pypi/packages/2e/81/99562b93d75f3fc5956fa65.

大家好,又见面了,我是你们的朋友全栈君。

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

Jason-MacBook-Pro:~ wangying$ pip install pymssql
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting pymssql
  Downloading http://mirrors.aliyun.com/pypi/packages/2e/81/99562b93d75f3fc5956fa65decfb35b38a4ee97cf93c1d0d3cb799fffb99/pymssql-2.1.4.tar.gz (691 kB)
     |████████████████████████████████| 691 kB 3.9 MB/s 
    ERROR: Command errored out with exit status 1:
     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
         cwd: /private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-4ndcppo8/pymssql/
    Complete output (7 lines):
    /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py:45: DistDeprecationWarning: Do not call this function
      warnings.warn("Do not call this function", DistDeprecationWarning)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-4ndcppo8/pymssql/setup.py", line 88, in <module>
        from Cython.Distutils import build_ext as _build_ext
    ModuleNotFoundError: No module named 'Cython'
    ----------------------------------------
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 库

Jason-MacBook-Pro:~ wangying$ pip install cython
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting cython
  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)
     |████████████████████████████████| 1.9 MB 3.4 MB/s 
Installing collected packages: cython
Successfully installed cython-0.29.20

接下来再次尝试:pip install pymssql

Jason-MacBook-Pro:~ wangying$ pip install pymssql
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting pymssql
  Downloading http://mirrors.aliyun.com/pypi/packages/2e/81/99562b93d75f3fc5956fa65decfb35b38a4ee97cf93c1d0d3cb799fffb99/pymssql-2.1.4.tar.gz (691 kB)
     |████████████████████████████████| 691 kB 2.6 MB/s 
    ERROR: Command errored out with exit status 1:
     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
         cwd: /private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-jugml9po/pymssql/
    Complete output (53 lines):
    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'.
    ERROR: Could not find a version that satisfies the requirement setuptools_git (from versions: none)
    ERROR: No matching distribution found for setuptools_git
    /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py:44: DistDeprecationWarning: Do not call this function
      warnings.warn("Do not call this function", DistDeprecationWarning)
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
        subprocess.check_call(cmd)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 363, in check_call
        raise CalledProcessError(retcode, cmd)
    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.
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/qn/tx7b6pr11ggfsw1ynzl24ntr0000gn/T/pip-install-jugml9po/pymssql/setup.py", line 482, in <module>
        ext_modules = ext_modules(),
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 163, in setup
        _install_setup_requires(attrs)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 158, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 698, in fetch_build_eggs
        replace_conflicting=True,
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
        replace_conflicting=replace_conflicting
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 754, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/installer.py", line 130, in fetch_build_egg
        raise DistutilsError(str(e))
    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.
    setup.py: platform.system() => 'Darwin'
    setup.py: platform.architecture() => ('64bit', '')
    setup.py: platform.libc_ver() => ('', '')
    setup.py: Detected Darwin/Mac OS X.
        You can install FreeTDS with Homebrew or MacPorts, or by downloading
        and compiling it yourself.
    
        Homebrew (http://brew.sh/)
        --------------------------
        brew install freetds
    
        MacPorts (http://www.macports.org/)
        -----------------------------------
        sudo port install freetds
    
    setup.py: Not using bundled FreeTDS
    setup.py: include_dirs = ['/usr/local/include']
    setup.py: library_dirs = ['/usr/local/lib']
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

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

       You can install FreeTDS with Homebrew or MacPorts, or by downloading
        and compiling it yourself.
    
        Homebrew (http://brew.sh/)
        --------------------------
        brew install freetds
    
        MacPorts (http://www.macports.org/)
        -----------------------------------
        sudo port install freetds

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

Jason-MacBook-Pro:~ wangying$ brew install freetds
Error: Another active Homebrew update process is already in progress.
Please wait for it to finish or terminate it to continue.
==> Downloading https://homebrew.bintray.com/bottles/libtool-2.4.6_2.high_sierra
==> Downloading from https://akamai.bintray.com/60/60c7d86f9364e166846f8d3fb2ba9
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/unixodbc-2.3.7.high_sierra.
==> Downloading from https://akamai.bintray.com/0b/0b30b166c0e6bbd9df375a018d0f2
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/freetds-1.1.42.high_sierra.
==> Downloading from https://akamai.bintray.com/bd/bd498b68beba699326bb17fb2e4c5
######################################################################## 100.0%
==> Installing dependencies for freetds: libtool and unixodbc
==> Installing freetds dependency: libtool
==> Pouring libtool-2.4.6_2.high_sierra.bottle.tar.gz
==> Caveats
In order to prevent conflicts with Apple's own libtool we have prepended a "g"
so, you have instead: glibtool and glibtoolize.
==> Summary
?  /usr/local/Cellar/libtool/2.4.6_2: 71 files, 3.7MB
==> Installing freetds dependency: unixodbc
==> Pouring unixodbc-2.3.7.high_sierra.bottle.1.tar.gz
?  /usr/local/Cellar/unixodbc/2.3.7: 46 files, 1.8MB
==> Installing freetds
==> Pouring freetds-1.1.42.high_sierra.bottle.tar.gz
?  /usr/local/Cellar/freetds/1.1.42: 66 files, 3.5MB
==> Caveats
==> libtool
In order to prevent conflicts with Apple's own libtool we have prepended a "g"
so, you have instead: glibtool and glibtoolize.

接下来继续安装pip install setuptools

还有pip install setuptools-git

在下来安装pip install pymssql即可安装成功

 

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/149962.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • okhttp的MediaType.parse属性

    okhttp的MediaType.parse属性okhttp的MediaType.parse属性学习记录MediaType指的是要传递的数据的MIME类型,MediaType对象包含了三种信息:type、subtype以及charset,一般将这些信息传入parse()方法中,这样就可以解析出MediaType对象,比如“text/x-markdown;charset=utf-8”,type值是text,表示是文本这一大类;/后面的…

    2022年5月26日
    33
  • 彻底卸载pycharm 恢复环境

    彻底卸载pycharm 恢复环境彻底卸载pycharm配置文件恢复最初环境

    2022年8月28日
    1
  • navicat15激活碼3月最新在线激活

    navicat15激活碼3月最新在线激活,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月15日
    47
  • idea2022.01.4激活码【2022最新】

    (idea2022.01.4激活码)JetBrains旗下有多款编译器工具(如:IntelliJ、WebStorm、PyCharm等)在各编程领域几乎都占据了垄断地位。建立在开源IntelliJ平台之上,过去15年以来,JetBrains一直在不断发展和完善这个平台。这个平台可以针对您的开发工作流进行微调并且能够提供…

    2022年4月1日
    86
  • windows安装git cmd_git for windows

    windows安装git cmd_git for windowsGitLFS(GitLargeFileStorge,Git大文件储存)。本文只介绍windows下的安装方式。写在前面,GitLFS安装依赖Git,所以我们先安装git下载地址【传送门】双击安装,直接next1.安装地址【传送门】2.安装双击->默认->确定->安装完成运行cmd下输入gitlfsinstall一般命令gitlfsinstall开启LFS功能gitlfstrackl文件追踪,一般后面”文件名.后缀”gitlf

    2022年9月8日
    0
  • CSS滚动条[通俗易懂]

    CSS滚动条[通俗易懂][1]定义[2]默认[3]尺寸[4]兼容[5]自定义

    2022年7月2日
    24

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号