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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • crontab使用方法_crontab用法

    crontab使用方法_crontab用法crontab使用方法记录如下,解决了一些问题:crontab-e执行后弹出编辑窗口,输入如下内容:/2***sleep10;/root/do.sh>/dev/null2>&1表示每2分钟执行一次检测ssh可连通的脚本。注意,脚本输出到/dev/null,以避免crontab报警到root的邮件中。

    2022年8月24日
    3
  • PyQuery用法详解

    PyQuery用法详解PyQuery是强大而又灵活的网页解析库,如果你觉得正则写起来太麻烦,如果你觉得BeautifulSoup语法太难记,如果你熟悉jQuery的语法那么,PyQuery就是你绝佳的选择。一、初始化方式,有三种,可以传入字符串,传入url,传入文件。字符串初始化html=”’&lt;div&gt;&lt;ul&gt;&lt;liclass="item-…

    2022年4月30日
    43
  • python初级:基础知识学习-循环、列表、元组、集合、字典

    python初级:基础知识学习-循环、列表、元组、集合、字典

    2021年10月6日
    35
  • 【用户画像】从0到1掌握用户画像知识体系

    【用户画像】从0到1掌握用户画像知识体系一、初始用户画像1.1用户画像随着用户的一切行为数据可以被企业追踪到,企业的关注点日益聚焦在如何利用大数据为经营分析和精准营销服务,而要做精细化运营,首先要建立本企业的用户画像。提到用户画像的概念,我们区分下用户角色(Persona)和用户画像(Profile):1.1.1用户角色用户角色本质是一个用以沟通的工具,当我们讨论产品、需求、场景、用户体验的时候,为了避免在目标用户理解上的分歧,用户角色应运而生。用户角色建立在对真实用户深刻理解,及高精准相关数据的概括之上,虚构的包含典型用

    2022年5月25日
    97
  • exec_command 详解_linux exec命令

    exec_command 详解_linux exec命令2D-Position允许通过拖曳移动绝对定位的对象。AbsolutePosition设定元素的position属性为“absolute”(绝对)。BackColor设置或获取当前选中区的背景颜色。BlockDirLTR目前尚未支持。BlockDirRTL目前尚未支持。Bold切换当前选中区的粗体显示与否。BrowseMode目前尚未支持。

    2022年10月29日
    0
  • 男女之间的友情和爱情

    男女之间的友情和爱情

    2021年8月5日
    58

发表回复

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

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