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)


相关推荐

  • Java正则匹配空格_js正则表达式匹配空格

    Java正则匹配空格_js正则表达式匹配空格需求针对tab键带来的多个空格问题,有时候我们针对带空格的一行数据要进行切割,如果有多个空格就会出现就会切割空格出现,我们想把空格都去掉,所以需要用到某些方法。解决方案利用正则表达式来匹配空格\\s+首先利用split(“\\s+”);方法来对字符串切割,尽可能的匹配空格,这里也挺有意思,因为空格数目不一样,可以动态变换匹配的空格数量,这个实现原理可以看看底层原理,挺有意思。测试:

  • 搭建自己的git服务器_自建服务器

    搭建自己的git服务器_自建服务器在服务器端:新建一个空git仓库sudogitinit–baresample.gitsudochown-Rgit:gitsample.git在本地:添加remotegitremoteaddmyservergit@server_ip:/path-to-git-repo把本地内容push上去gitadd.gitcommit-m”xxx”…

  • reverseFind()[通俗易懂]

    reverseFind()[通俗易懂]最佳答案是从字符串结尾开始检索,但是计算还是从开始的0起计,所以检索到第二个’b’是4abca==s.left(s.ReverseFind(‘b’));

  • Odin Inspector 系列教程 — Indent Attribute「建议收藏」

    Odin Inspector 系列教程 — Indent Attribute「建议收藏」IndentAttribute特性:用于缩进可用于任何属性,并将属性的标签向右移动。使用它可以清楚地组织检查器中的属性。usingSirenix.OdinInspector;usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;publicclass…

  • asp.net面试题

    asp.net面试题ASP.NET常见面试题及答案(130题)1.简述private、protected、public、internal修饰符的访问权限。答.private:私有成员,在类的内部才可

  • 查看GCC版本_qt版本

    查看GCC版本_qt版本查看交叉编译器的GCC版本:hedy@ubuntu:~/u-boot$arm-poky-linux-gnueabi-gcc-v查看本地编译器的GCC版本:hedy@ubuntu:~/u-boot$gcc-vhedy@ubuntu:~/u-boot$whicharm-poky-linux-gnueabi-gcc/opt/fsl-imx-fb/4.1.15-2.1.0/s…

发表回复

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

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