首页 > 解决方案 > 我在下载 python 包 fast_slic 时遇到问题

问题描述

我正在尝试下载 python 包 fast_slic。我已经在这里下载了必要的文件:https ://pypi.org/project/fast-slic/#files 。我还安装了 Microsoft Visual Studio 安装程序来帮助这个过程。这是我使用的代码和我收到的错误消息:

pip install fast_slic

Collecting fast_slicNote: you may need to restart the kernel to use updated packages.   Using cached fast-slic-0.4.0.tar.gz (47 kB) Requirement already satisfied: numpy in c:\users\david\appdata\local\programs\python\python39\lib\site-packages (from fast_slic) (1.19.5) Building wheels for collected packages: fast-slic

  ERROR: Command errored out with exit status 1:    command: 'C:\Users\David\AppData\Local\Programs\Python\Python39\python.exe' -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-g7wsi08t\\fast-slic_eeed0754caf74386bc0ad33b27a930a6\\setup.py'"'"';
__file__='"'"'C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-g7wsi08t\\fast-slic_eeed0754caf74386bc0ad33b27a930a6\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\David\AppData\Local\Temp\pip-wheel-z2t076vn'
       cwd: C:\Users\David\AppData\Local\Temp\pip-install-g7wsi08t\fast-slic_eeed0754caf74386bc0ad33b27a930a6\ Complete output (30 lines):   Building wheel for fast-slic (setup.py): started   Building wheel for fast-slic (setup.py): finished with status 'error'   Running setup.py clean for fast-slic Failed to build fast-slic Installing collected packages: fast-slic
    Running setup.py install for fast-slic: started
    Running setup.py install for fast-slic: finished with status 'error'   running bdist_wheel   running build   running build_py   creating build   creating build\lib.win-amd64-3.9   creating build\lib.win-amd64-3.9\cpuid   copying cpuid\cpuid.py -> build\lib.win-amd64-3.9\cpuid   copying cpuid\__init__.py -> build\lib.win-amd64-3.9\cpuid   creating build\lib.win-amd64-3.9\fast_slic show more (open the raw output data in a text editor) ...

    C:\Users\David\AppData\Local\Programs\Python\Python39\include\pyconfig.h(201): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
    C:\Users\David\AppData\Local\Programs\Python\Python39\include\pyconfig.h(201): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
    ---------------------------------------- ERROR: Command errored out with exit status 1: 'C:\Users\David\AppData\Local\Programs\Python\Python39\python.exe' -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-g7wsi08t\\fast-slic_eeed0754caf74386bc0ad33b27a930a6\\setup.py'"'"';
__file__='"'"'C:\\Users\\David\\AppData\\Local\\Temp\\pip-install-g7wsi08t\\fast-slic_eeed0754caf74386bc0ad33b27a930a6\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\David\AppData\Local\Temp\pip-record-ik_8uebk\install-record.txt'
--single-version-externally-managed --compile --install-headers 'C:\Users\David\AppData\Local\Programs\Python\Python39\Include\fast-slic' Check the logs for full command output.

我在笔记本电脑上运行 Windows。任何帮助是极大的赞赏

标签: pythonc++installationpip

解决方案


如果您在 Windows 中尝试在命令提示符 py -m pip install fast-slic下运行?


推荐阅读