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 'pbr'" on install #120

Closed
n00bsys0p opened this issue Sep 21, 2020 · 3 comments
Closed

"ModuleNotFoundError: No module named 'pbr'" on install #120

n00bsys0p opened this issue Sep 21, 2020 · 3 comments

Comments

@n00bsys0p
Copy link

n00bsys0p commented Sep 21, 2020

Hi,

On versions >=0.4.0, I'm getting an error during install relating to the module "pbr". I do have this module installed, and have tested the line of code which is causing the error, which appears to work fine in a slightly contrived context as shown in the below text. Full error included at the end.

$ python
Python 3.8.5 (default, Aug 16 2020, 17:44:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> __import__('pbr', fromlist=['__name__'], level=0)
<module 'pbr' from '/home/user/.pyenv/versions/project/lib/python3.8/site-packages/pbr/__init__.py'>
$ pip install -U grpclib --ignore-installed --no-cache
Collecting grpclib
  Downloading grpclib-0.4.1.tar.gz (57 kB)
     |████████████████████████████████| 57 kB 692 kB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /home/user/.pyenv/versions/3.8.5/envs/project/bin/python3.8 /home/user/.pyenv/versions/3.8.5/envs/project/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpgcws3rws
       cwd: /tmp/pip-install-2xmwencb/grpclib
  Complete output (34 lines):
  running egg_info
  writing grpclib.egg-info/PKG-INFO
  writing dependency_links to grpclib.egg-info/dependency_links.txt
  writing entry points to grpclib.egg-info/entry_points.txt
  writing requirements to grpclib.egg-info/requires.txt
  writing top-level names to grpclib.egg-info/top_level.txt
  Traceback (most recent call last):
    File "/home/user/.pyenv/versions/3.8.5/envs/project/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/home/user/.pyenv/versions/3.8.5/envs/project/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/user/.pyenv/versions/3.8.5/envs/project/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-b003fdk4/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 149, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "/tmp/pip-build-env-b003fdk4/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 130, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-b003fdk4/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 145, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 3, in <module>
      setuptools.setup()
    File "/tmp/pip-build-env-b003fdk4/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/home/user/.pyenv/versions/3.8.5/lib/python3.8/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/home/user/.pyenv/versions/3.8.5/lib/python3.8/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/home/user/.pyenv/versions/3.8.5/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-b003fdk4/overlay/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 285, in run
      writer = ep.resolve()
    File "/home/user/.pyenv/versions/3.8.5/envs/project/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2478, in resolve
      module = __import__(self.module_name, fromlist=['__name__'], level=0)
  ModuleNotFoundError: No module named 'pbr'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/.pyenv/versions/3.8.5/envs/project/bin/python3.8 /home/user/.pyenv/versions/3.8.5/envs/project/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpgcws3rws Check the logs for full command output.
@n00bsys0p n00bsys0p changed the title ModuleNotFoundError: No module named 'pbr' on install "ModuleNotFoundError: No module named 'pbr'" on install Sep 21, 2020
@vmagamedov
Copy link
Owner

I've tried to install grpclib into an environment with a latest pbr library installed before and have no errors. Can you provide more info about your environment? Which versions of setuptools/pip/pbr do you have? Can you try to install grpclib into a fresh virtualenv?

Maybe you can figure out what is wrong with grpclib? The only change I think of is that now I'm using version constrains in setup.cfg to specify h2 version more precisely:

grpclib/setup.cfg

Lines 27 to 28 in bb9f450

install_requires=
h2<5,>=3.1.0

@vmagamedov
Copy link
Owner

And to be clear grpclib is not using pbr. It is pbr affects how grpclib is getting installed in some strange ways.

@n00bsys0p
Copy link
Author

n00bsys0p commented Sep 21, 2020

Ok - so first up, apologies for the trouble. Uinstalling and reinstalling my pyenv venv from scratch has resolved the problem.

The package in my project which brings in pbr is bandit, so I guess an old version of either of these must have been causing the error.

Thanks for your time!

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