安装pyspec时遇到问题error: subprocess-exited-with-error SyntaxError: multiple exception types must be paren

安装pyspec时遇到问题:

WARNING: Ignoring invalid distribution -yproj (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -illow (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -yproj (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -illow (d:\app\python\python310\lib\site-packages)
Collecting pyspec
  Downloading pyspec-0.2-r213.tar.gz (3.3 MB)
     ---------------------------------------- 3.3/3.3 MB 1.0 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "E:\tempfiles_for_python\pip-install-1fsabzy3\pyspec_dd95ca602af2494e907109e942e148de\setup.py", line 15, in <module>
          from ez_setup import use_setuptools
        File "E:\tempfiles_for_python\pip-install-1fsabzy3\pyspec_dd95ca602af2494e907109e942e148de\ez_setup.py", line 106
          except pkg_resources.VersionConflict, e:
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      SyntaxError: multiple exception types must be parenthesized
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
WARNING: Ignoring invalid distribution -yproj (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -illow (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -yproj (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -illow (d:\app\python\python310\lib\site-packages)

原因是官网上pyspec对应的python版本是python2,而非我下载的python3

解决方法
通过github下载。
首先打开网页:https://github.com/pyspec/pyspec,下载压缩包,将压缩包放到Scripts所在文件夹内(python\python310\Scripts\),并解压为dp_spectra-master文件夹。
打开cmd命令窗口,将位置定位到dp_spectra-master文件夹内,根据github网站指引,输入操作:

python setup.py install

输出:

D:\app\python\python310\Scripts\pyspec-master>python setup.py install
D:\app\python\python310\lib\site-packages\setuptools\dist.py:506: UserWarning: Normalizing '0.1dev1' to '0.1.dev1'
  warnings.warn(tmpl.format(**locals()))
running install
D:\app\python\python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
D:\app\python\python310\lib\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
creating pyspec.egg-info
writing pyspec.egg-info\PKG-INFO
writing dependency_links to pyspec.egg-info\dependency_links.txt
writing requirements to pyspec.egg-info\requires.txt
writing top-level names to pyspec.egg-info\top_level.txt
writing manifest file 'pyspec.egg-info\SOURCES.txt'
reading manifest file 'pyspec.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'pyspec.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\pyspec
copying pyspec\helmholtz.py -> build\lib\pyspec
copying pyspec\spectrum.py -> build\lib\pyspec
copying pyspec\__init__.py -> build\lib\pyspec
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\pyspec
copying build\lib\pyspec\helmholtz.py -> build\bdist.win-amd64\egg\pyspec
copying build\lib\pyspec\spectrum.py -> build\bdist.win-amd64\egg\pyspec
copying build\lib\pyspec\__init__.py -> build\bdist.win-amd64\egg\pyspec
byte-compiling build\bdist.win-amd64\egg\pyspec\helmholtz.py to helmholtz.cpython-310.pyc
byte-compiling build\bdist.win-amd64\egg\pyspec\spectrum.py to spectrum.cpython-310.pyc
byte-compiling build\bdist.win-amd64\egg\pyspec\__init__.py to __init__.cpython-310.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying pyspec.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying pyspec.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pyspec.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pyspec.egg-info\not-zip-safe -> build\bdist.win-amd64\egg\EGG-INFO
copying pyspec.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pyspec.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
creating dist
creating 'dist\pyspec-0.1.dev1-py3.10.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing pyspec-0.1.dev1-py3.10.egg
creating d:\app\python\python310\lib\site-packages\pyspec-0.1.dev1-py3.10.egg
Extracting pyspec-0.1.dev1-py3.10.egg to d:\app\python\python310\lib\site-packages
Adding pyspec 0.1.dev1 to easy-install.pth file

Installed d:\app\python\python310\lib\site-packages\pyspec-0.1.dev1-py3.10.egg
Processing dependencies for pyspec==0.1.dev1
Searching for numpy==1.22.0
Best match: numpy 1.22.0
Adding numpy 1.22.0 to easy-install.pth file
Installing f2py-script.py script to D:\app\python\python310\Scripts
Installing f2py.exe script to D:\app\python\python310\Scripts

Using d:\app\python\python310\lib\site-packages
Finished processing dependencies for pyspec==0.1.dev1

安装成功。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值