pip安装pymssql模块时报错“PEP 517”怎么解决?

欲在ubuntu上安装pymssql,使用pip install pymssql操作,报错如下

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pymssql
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/4a/20/bcd4db9e7990b50e85280f0c9488c0a53f7e6bf9048203448d8e0f29a536/pymssql-3.0.3.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: pymssql
  Building wheel for pymssql (PEP 517) ... error
  ERROR: Complete output from command /home/ps/.conda/envs/tensorflow-gpu/bin/python /home/ps/.conda/envs/tensorflow-gpu/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp0ch3x7b2:
  ERROR: running bdist_wheel
  running build
  installing to build/bdist.linux-x86_64/wheel
  running install
  /tmp/pip-build-env-_hpbcwoh/overlay/lib/python3.7/site-packages/setuptools/dist.py:46: DistDeprecationWarning: Do not call this function
    warnings.warn("Do not call this function", DistDeprecationWarning)
  Traceback (most recent call last):
    File "/home/ps/.conda/envs/tensorflow-gpu/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
      main()
    File "/home/ps/.conda/envs/tensorflow-gpu/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/ps/.conda/envs/tensorflow-gpu/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 141, in build_wheel
      metadata_directory)
    File "/tmp/pip-build-env-_hpbcwoh/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 209, in build_wheel
      wheel_directory, config_settings)
    File "/tmp/pip-build-env-_hpbcwoh/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 194, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-_hpbcwoh/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 237, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-_hpbcwoh/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 142, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 493, in <module>
      tests_require=['pytest', 'unittest2'],
    File "/tmp/pip-build-env-_hpbcwoh/overlay/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/home/ps/.conda/envs/tensorflow-gpu/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/home/ps/.conda/envs/tensorflow-gpu/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/home/ps/.conda/envs/tensorflow-gpu/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-_hpbcwoh/overlay/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 228, in run
      self.run_command('install')
    File "/home/ps/.conda/envs/tensorflow-gpu/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/home/ps/.conda/envs/tensorflow-gpu/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "setup.py", line 449, in run
      raise DeprecationWarning(msg)
  DeprecationWarning: The pymssql project has been discontinued.  To install the last working released version, use a
  version specifier like "pymssql<3.0".  For details and alternatives see:
  https://github.com/pymssql/pymssql/issues/668
  ----------------------------------------
  ERROR: Failed building wheel for pymssql
  Running setup.py clean for pymssql
Failed to build pymssql
ERROR: Could not build wheels for pymssql which use PEP 517 and cannot be installed directly

观察报错信息,在第五十一行给了一个解决办法,安装版本"pymssql<3.0",所以开始报错的原因就是版本的不匹配,解决方案如下:pip install “pymssql<3.0”

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值