Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install cytoolz using pip on windows 11 and python 3.10 #163

Closed
XiaoHuiHui233 opened this issue Jun 17, 2022 · 2 comments
Closed

Comments

@XiaoHuiHui233
Copy link

XiaoHuiHui233 commented Jun 17, 2022

Basic environments:

Windows 11
conda 4.13.0 (Miniconda3)
pip 22.1.2 (python 3.10) in conda virtual environment
Visual Studio 2022 with VC++ build tools 14.3 and 14.0 installed
Cython 0.29.30

Basically, the problem I encountered is similar to #151, #155, #157, but my environment is VC instead of GCC or Clang. It shows the wheels builder cannot find VC++ build tools v14.0 or higher. But I have installed VS 2022 and almost all the SDKs for VC++ desktop development, including build tools v14.3 and windows 10&11 sdk. I've also tried downloading the VC++ Build Tools v14.2 separately using its recommended installer tool, but it still doesn't work. The specific logs are as follows:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting cytoolz
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b7/a9/9437d8e6a8ba420cb52832a4895614c61bf574bfb3978d5b0806b8ab95be/cytoolz-0.11.2.tar.gz (481 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: toolz>=0.8.0 in d:\miniconda3\envs\ethfinder\lib\site-packages (from cytoolz) (0.11.2)
Building wheels for collected packages: cytoolz
  Building wheel for cytoolz (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [53 lines of output]
      [1/5] Cythonizing cytoolz/utils.pyx
      [2/5] Cythonizing cytoolz/dicttoolz.pyx
      [3/5] Cythonizing cytoolz/functoolz.pyx
      [4/5] Cythonizing cytoolz/itertoolz.pyx
      [5/5] Cythonizing cytoolz/recipes.pyx
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\compatibility.py -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\_signatures.py -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\_version.py -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\__init__.py -> build\lib.win-amd64-3.10\cytoolz
      creating build\lib.win-amd64-3.10\cytoolz\curried
      copying cytoolz\curried\exceptions.py -> build\lib.win-amd64-3.10\cytoolz\curried
      copying cytoolz\curried\operator.py -> build\lib.win-amd64-3.10\cytoolz\curried
      copying cytoolz\curried\__init__.py -> build\lib.win-amd64-3.10\cytoolz\curried
      copying cytoolz\dicttoolz.pyx -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\functoolz.pyx -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\itertoolz.pyx -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\recipes.pyx -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\utils.pyx -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\cpython.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\dicttoolz.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\functoolz.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\itertoolz.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\recipes.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\utils.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\__init__.pxd -> build\lib.win-amd64-3.10\cytoolz
      creating build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\dev_skip_test.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_compatibility.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_curried.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_curried_toolzlike.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_dev_skip_test.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_dicttoolz.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_docstrings.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_doctests.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_embedded_sigs.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_functoolz.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_inspect_args.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_itertoolz.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_none_safe.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_recipes.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_serialization.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_signatures.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_tlz.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_utils.py -> build\lib.win-amd64-3.10\cytoolz\tests
      running build_ext
      building 'cytoolz.dicttoolz' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cytoolz
  Running setup.py clean for cytoolz
Failed to build cytoolz
Installing collected packages: cytoolz
  Running setup.py install for cytoolz ... error
  error: subprocess-exited-with-error

  × Running setup.py install for cytoolz did not run successfully.
  │ exit code: 1
  ╰─> [55 lines of output]
      [1/5] Cythonizing cytoolz/utils.pyx
      [2/5] Cythonizing cytoolz/dicttoolz.pyx
      [3/5] Cythonizing cytoolz/functoolz.pyx
      [4/5] Cythonizing cytoolz/itertoolz.pyx
      [5/5] Cythonizing cytoolz/recipes.pyx
      running install
      D:\miniconda3\envs\ethfinder\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(
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\compatibility.py -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\_signatures.py -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\_version.py -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\__init__.py -> build\lib.win-amd64-3.10\cytoolz
      creating build\lib.win-amd64-3.10\cytoolz\curried
      copying cytoolz\curried\exceptions.py -> build\lib.win-amd64-3.10\cytoolz\curried
      copying cytoolz\curried\operator.py -> build\lib.win-amd64-3.10\cytoolz\curried
      copying cytoolz\curried\__init__.py -> build\lib.win-amd64-3.10\cytoolz\curried
      copying cytoolz\dicttoolz.pyx -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\functoolz.pyx -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\itertoolz.pyx -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\recipes.pyx -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\utils.pyx -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\cpython.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\dicttoolz.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\functoolz.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\itertoolz.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\recipes.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\utils.pxd -> build\lib.win-amd64-3.10\cytoolz
      copying cytoolz\__init__.pxd -> build\lib.win-amd64-3.10\cytoolz
      creating build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\dev_skip_test.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_compatibility.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_curried.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_curried_toolzlike.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_dev_skip_test.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_dicttoolz.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_docstrings.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_doctests.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_embedded_sigs.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_functoolz.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_inspect_args.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_itertoolz.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_none_safe.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_recipes.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_serialization.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_signatures.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_tlz.py -> build\lib.win-amd64-3.10\cytoolz\tests
      copying cytoolz\tests\test_utils.py -> build\lib.win-amd64-3.10\cytoolz\tests
      running build_ext
      building 'cytoolz.dicttoolz' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> cytoolz

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I noticed that this process is actually compiling the wheel and installing it. The problem lies in the process of compiling with Cython. There is no runnable compilation environment at the beginning. But this is very strange, it should be able to identify the corresponding environment by itself, could it be that I accidentally modified something? If so what should I modify to fix it?

For that, I found this documentation and I tried updating setuptools but it is already latest. This documentation also says that these environments should be recognized automatically, I still can't find a way how to manually specify or fix what I may have misconfigured in the past.

@eriknw
Copy link
Member

eriknw commented Jul 11, 2022

We now build wheels for cytoolz, which hopefully fixes this issue. Can you try using version 0.12.0?

@XiaoHuiHui233
Copy link
Author

OK. I tried the latest version of the wheel and it worked fine. The problem is solved.
However, I still want to know whether this is a problem with the compilation process or my configuration. Because I am not sure when the same problem occur next time and there is no wheel I can use, what should I do. Can you give a conclusion in this regard?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants