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

ModuleNotFoundError: No module named 'psutil' #1923

Closed
electronhead opened this issue Feb 25, 2021 · 1 comment
Closed

ModuleNotFoundError: No module named 'psutil' #1923

electronhead opened this issue Feb 25, 2021 · 1 comment

Comments

@electronhead
Copy link

Summary

  • OS: macos 11.2.1 big sur
  • Architecture: intel 64-bit
  • Psutil version: Version: 5.8.0
  • Python version: 3.9
  • Type: { build }

Description

psutils works perfectly in my application on the mac as well as raspberry pi os, but when I invoke
python3 -m build I get the traceback below.

I then tried pip install --no-binary :all: psutil per the psutil documentation, still ending up with the stack trace below. xcode is installed BTW.

I've moved import statements around in the code with no effect.

I've also deleted venv, rebuilt it, installed all of the necessary packages, with the same traceback.

I've uninstalled and reinstalled psutil with pip and have deleted the two directories in site-packages and then pip-reinstalled. Same results.

Any tips would be greatly appreciated.

traceback

File "/Users/electronhead/dev/whendo/./whendo/__init__.py", line 5, in <module>
    import whendo.core.action_imports
  File "/Users/electronhead/dev/whendo/./whendo/core/action_imports.py", line 6, in <module>
    import whendo.core.util
  File "/Users/electronhead/dev/whendo/./whendo/core/util.py", line 4, in <module>
    import psutil
ModuleNotFoundError: No module named 'psutil'
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/var/folders/mn/_hmz7tnd5gd3w_kpdq3c_w_c0000gp/T/build-env-y8zmfs6u/bin/python', '/Users/electronhead/dev/whendo/venv/lib/python3.9/site-packages/pep517/_in_process.py', 'get_requires_for_build_sdist', '/var/folders/mn/_hmz7tnd5gd3w_kpdq3c_w_c0000gp/T/tmpcmhcjjuu']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/electronhead/dev/whendo/venv/lib/python3.9/site-packages/build/__init__.py", line 241, in get_dependencies
    raise BuildBackendException(e)
build.BuildBackendException: Backend operation failed: CalledProcessError(1, ['/var/folders/mn/_hmz7tnd5gd3w_kpdq3c_w_c0000gp/T/build-env-y8zmfs6u/bin/python', '/Users/electronhead/dev/whendo/venv/lib/python3.9/site-packages/pep517/_in_process.py', 'get_requires_for_build_sdist', '/var/folders/mn/_hmz7tnd5gd3w_kpdq3c_w_c0000gp/T/tmpcmhcjjuu'])

ERROR Backend operation failed: CalledProcessError(1, ['/var/folders/mn/_hmz7tnd5gd3w_kpdq3c_w_c0000gp/T/build-env-y8zmfs6u/bin/python', '/Users/electronhead/dev/whendo/venv/lib/python3.9/site-packages/pep517/_in_process.py', 'get_requires_for_build_sdist', '/var/folders/mn/_hmz7tnd5gd3w_kpdq3c_w_c0000gp/T/tmpcmhcjjuu'])

pyproject.toml...

[build-system]

requires = [
    "setuptools >= 42",
    "wheel"
]
build-backend = "setuptools.build_meta"

setup.py

import setuptools

setuptools.setup()

setup.cfg

[metadata]
name = whendo
version = attr: whendo._version.version
description = action scheduling api, sdk
long_description = file: README.md
long_description_content_type = text/markdown
author_email = beaver@electronhead.com
url = https://github.com/electronhead/whendo
license = MIT
keywords = scheduling, api
classifiers =
    Intended Audience :: Developers
    License :: OSI Approved :: MIT License
    Programming Language :: Python :: 3.9
    Operating System :: OS Independent

[options]
install_requires =
    uvicorn >= 0.13.3
    fastapi >= 0.63.0
    pydantic >= 1.7.3
    schedule >= 1.0.0
    requests >= 2.25.1
    psutil >= 5.8.0
    Mock.GPIO >= 0.1.7

include_package_data = False

package_dir =
    = .
packages = find:

[options.packages.find]
exclude =
    tests
@AshishA13
Copy link

I resolved this issue as below: It seems, every time i was trying to upgrade psutil using "pip install psutil" it just showing "the requirement is satisfied and showing 5.7.2."

Use below steps to resolve this issue:

  1. Go to the folder where Python is install and psutil is available e.g. "C:\Python\Lib\site-packages"
  2. find all psutil related filesand rename them to something else e.g. Old__psutil Old_psutil-5.7.2.dist-info
  3. Run "pip install psutil" from bash or command line
  4. It updated for me to 5.8.0
    This resolved my issue.

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

3 participants