安装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 pyspecDownloading pyspec-0.2-r213.tar.gz (3.3 MB)---------------------------------------- 3.3/3.3 MB 1.0 MB/s eta 0:00:00Preparing metadata (setup.py) ... errorerror: 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_setuptoolsFile "E:\tempfiles_for_python\pip-install-1fsabzy3\pyspec_dd95ca602af2494e907109e942e148de\ez_setup.py", line 106except 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 fileInstalled 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\ScriptsUsing d:\app\python\python310\lib\site-packages
Finished processing dependencies for pyspec==0.1.dev1
安装成功。