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即可安装成功

 

 

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

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

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • Spring的contextConfigLocation

    Spring的contextConfigLocationspring如何使用多个xml配置文件1,在web.xml中定义contextConfigLocation参数.spring会使用这个参数加载.所有逗号分割的xml.如果没有这个参数,spring默认加载web-inf/applicationContext.xml文件.例如:<context-param><param-name>conte…

  • IOS框架概览

    IOS框架概览

  • 关于W25Q128地址的定义

    1.W25Q128将16M的内存分为256个块,每个块是64K;又将一个块分为16个扇区,一个扇区是4K;又将一个扇区分为16个页,一个页是256字节地址。话不多说,上图:2.在图上右边的红框中可以看到Block0(块0)的地址是000000-00FFFF,再看到左边红框中Block0的16个扇区,地址范围对应的就是Block0的地址范围了,第一个扇区的起始地址就是0000,终止地址是0F…

  • java拦截器的配置_Java 拦截器配置及使用「建议收藏」

    java拦截器的配置_Java 拦截器配置及使用「建议收藏」packagecom.panshi.ProjectInterceptor.Interceptor;importorg.slf4j.Logger;importorg.slf4j.LoggerFactory;importorg.springframework.stereotype.Component;importorg.springframework.util.StringUtils;importor…

  • lseek函数

    lseek函数转自:https://baike.baidu.com/item/lseek/6385407?fr=aladdin相关函数dup,open,fseek表头文件#include#include定义函数off_tlseek(intfilde,off_toffset,intwhence);

  • Java栈结构_栈java

    Java栈结构_栈javaJava栈结构概念典型的栈结构如下图所示:栈结构只能在一端操作,该操作端叫做栈顶,另一端叫做栈底。栈结构按照“后进先出”(LastInFirstOut,LIFO)的方式处理结点数据。栈的特点:其实栈结构是一种受限制的线性数据结构。其限制是仅允许在表的一端进行插入和删除运算。这一端被称为栈顶,相对地,把另一端称为栈底。向一个栈插入新元素又称作进栈、入栈或压栈,它是把新元素放到栈顶元素的上面,使之成为新的栈顶元素;从一个栈删除元素又称作出栈或退栈,它是把栈顶元素删除掉,使其相

发表回复

您的电子邮箱地址不会被公开。

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