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

windows 10 - python 3.11.0 - error installing psutil #2165

Closed
Trid-collab opened this issue Oct 27, 2022 · 20 comments
Closed

windows 10 - python 3.11.0 - error installing psutil #2165

Trid-collab opened this issue Oct 27, 2022 · 20 comments

Comments

@Trid-collab
Copy link

Trid-collab commented Oct 27, 2022

While I am trying to install psutil on windows 10 with python 3.11.0, I getting the following error
Could you direct me to how to resolve it

` __building 'psutil._psutil_windows' 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 psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects__ `

@lafargeremi
Copy link

Hi, i have the same error here. I tried a few version of VC++ without any success.

@EpicWink
Copy link

Duplicates #2163

@jansenicus
Copy link

jansenicus commented Nov 3, 2022

same error in Linux Ubuntu 22.04.1 LTS when installing psutil

@hidara2000
Copy link

hidara2000 commented Nov 5, 2022

same here. This worked
#2163

@yangbohust
Copy link

same error in linux aarch64

(base) root@davinci-mini:/home/HwHiAiUser# pip install --no-binary :all: psutil
DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
Looking in indexes: https://pypi.douban.com/simple
Collecting psutil
  Downloading https://pypi.doubanio.com/packages/de/eb/1c01a34c86ee3b058c556e407ce5b07cb7d186ebe47b3e69d6f152ca5cc5/psutil-5.9.3.tar.gz (483 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 483.6/483.6 kB 3.5 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: psutil
  Building wheel for psutil (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for psutil (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [45 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-39
      creating build/lib.linux-aarch64-cpython-39/psutil
      copying psutil/_psosx.py -> build/lib.linux-aarch64-cpython-39/psutil
      copying psutil/_psposix.py -> build/lib.linux-aarch64-cpython-39/psutil
      copying psutil/_pssunos.py -> build/lib.linux-aarch64-cpython-39/psutil
      copying psutil/_psaix.py -> build/lib.linux-aarch64-cpython-39/psutil
      copying psutil/_pswindows.py -> build/lib.linux-aarch64-cpython-39/psutil
      copying psutil/_pslinux.py -> build/lib.linux-aarch64-cpython-39/psutil
      copying psutil/_common.py -> build/lib.linux-aarch64-cpython-39/psutil
      copying psutil/__init__.py -> build/lib.linux-aarch64-cpython-39/psutil
      copying psutil/_psbsd.py -> build/lib.linux-aarch64-cpython-39/psutil
      copying psutil/_compat.py -> build/lib.linux-aarch64-cpython-39/psutil
      creating build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_testutils.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_posix.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_linux.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/__main__.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_process.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_system.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/__init__.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/runner.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      running build_ext
      building 'psutil._psutil_linux' extension
      creating build/temp.linux-aarch64-cpython-39
      creating build/temp.linux-aarch64-cpython-39/psutil
      gcc -pthread -B /usr/local/miniconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -n1 .2-a+fp16+rcpc+dotprod+crypto -isystem /usr/local/miniconda3/include -I/usr/local/miniconda3/include -fPIC -O2 -n1 .2-a+fp16+rcpc+dotprod+crypto -isystem /usr/local/miniconda3/include -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=593 -DPSUTIL_LINUX=1 -I/usr/local/miniconda3/include/python3.9 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-cpython-39/psutil/_psutil_common.o
      gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
      gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
      gcc: error: unrecognized command line option ‘-n1’; did you mean ‘-n’?
      gcc: error: unrecognized command line option ‘-n1’; did you mean ‘-n’?
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects

@whehdwns
Copy link

whehdwns commented Nov 6, 2022

Same Error

@cdeline
Copy link

cdeline commented Nov 7, 2022

Same error - Python 3.9, Windows 10

@topout
Copy link

topout commented Nov 7, 2022

I also have the same issue.

@cosmic-latte
Copy link

Same Error
Anaconda 2022.10 Windows 11

Building wheels for collected packages: psutil
Building wheel for psutil (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for psutil (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [38 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\psutil
copying psutil_common.py -> build\lib.win-amd64-cpython-39\psutil
copying psutil_compat.py -> build\lib.win-amd64-cpython-39\psutil
copying psutil_psaix.py -> build\lib.win-amd64-cpython-39\psutil
copying psutil_psbsd.py -> build\lib.win-amd64-cpython-39\psutil
copying psutil_pslinux.py -> build\lib.win-amd64-cpython-39\psutil
copying psutil_psosx.py -> build\lib.win-amd64-cpython-39\psutil
copying psutil_psposix.py -> build\lib.win-amd64-cpython-39\psutil
copying psutil_pssunos.py -> build\lib.win-amd64-cpython-39\psutil
copying psutil_pswindows.py -> build\lib.win-amd64-cpython-39\psutil
copying psutil_init_.py -> build\lib.win-amd64-cpython-39\psutil
creating build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\runner.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_aix.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_bsd.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_connections.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_contracts.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_linux.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_memleaks.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_misc.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_osx.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_posix.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_process.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_sunos.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_system.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_testutils.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_unicode.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests\test_windows.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests_init_.py -> build\lib.win-amd64-cpython-39\psutil\tests
copying psutil\tests_main_.py -> build\lib.win-amd64-cpython-39\psutil\tests
running build_ext
building 'psutil._psutil_windows' 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 psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects

@cosmic-latte
Copy link

If there are no special needs, you can install the old version first and wait for the update.
pip install psutil==5.9.3 works for me.

@osamaaleem
Copy link

I got the same error

@IanWilmutF09
Copy link

I got the same error. I've tried different syntax to install psutil but all didn't work.

@yirmio
Copy link

yirmio commented Nov 8, 2022

Same error for me
Windows Server 2019
Python 3.9.5

@Toh-git
Copy link

Toh-git commented Nov 8, 2022

You guys have to download Microsoft Visual Studio and install C++ MSVC v14.
This takes time and then
pip install psutil

@giampaolo
Copy link
Owner

I should have this fixed today. Hang tight.

@giampaolo
Copy link
Owner

This should now be fixed. Please confirm.

~/svn/psutil {master}$ python3 -m twine upload dist/psutil-5.9.4-cp36-abi3-win32.whl  dist/psutil-5.9.4-cp36-abi3-win_amd64.whl 
Uploading distributions to https://upload.pypi.org/legacy/
Uploading psutil-5.9.4-cp36-abi3-win32.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 275.0/275.0 kB • 00:00 • 780.9 kB/s
Uploading psutil-5.9.4-cp36-abi3-win_amd64.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 280.3/280.3 kB • 00:00 • 25.7 MB/s

View at:
https://pypi.org/project/psutil/5.9.4/

@osamaaleem
Copy link

This should now be fixed. Please confirm.

~/svn/psutil {master}$ python3 -m twine upload dist/psutil-5.9.4-cp36-abi3-win32.whl  dist/psutil-5.9.4-cp36-abi3-win_amd64.whl 
Uploading distributions to https://upload.pypi.org/legacy/
Uploading psutil-5.9.4-cp36-abi3-win32.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 275.0/275.0 kB • 00:00 • 780.9 kB/s
Uploading psutil-5.9.4-cp36-abi3-win_amd64.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 280.3/280.3 kB • 00:00 • 25.7 MB/s

View at:
https://pypi.org/project/psutil/5.9.4/

Yes, it's working now.

@giampaolo
Copy link
Owner

Thanks @mayeut / #2168.

@Antsypc
Copy link

Antsypc commented Nov 18, 2022

hello, I still got this error, on arm64, ubuntu18.04, python3.9. I have tried both 5.9.4 and 5.9.3.

gcc is 7.5.0, need to upgrade to higher version ?

      copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-cpython-39/psutil/tests
      running build_ext
      building 'psutil._psutil_linux' extension
      creating build/temp.linux-aarch64-cpython-39
      creating build/temp.linux-aarch64-cpython-39/psutil
      gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -n1 .2-a+fp16+rcpc+dotprod+crypto -isystem /opt/conda/include -I/opt/conda/include -fPIC -O2 -n1 .2-a+fp16+rcpc+dotprod+crypto -isystem /opt/conda/include -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=593 -DPSUTIL_LINUX=1 -I/opt/conda/include/python3.9 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-cpython-39/psutil/_psutil_common.o
      gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
      gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
      gcc: error: unrecognized command line option ‘-n1’; did you mean ‘-n’?
      gcc: error: unrecognized command line option ‘-n1’; did you mean ‘-n’?
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects

jonathanmetzman added a commit to google/clusterfuzz that referenced this issue Jul 25, 2023
I think I must've installed a newer psutil to get this working last
time.
giampaolo/psutil#2165
I've confirmed this works on a linux machine without a compiler 
CC @mihaimaruseac
@AnitaSherry
Copy link

Do I have to upgrade to the Python version? Is version 3.9 not supported?

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

No branches or pull requests