pip can't find a package even though it's installed

servoz's Avatar

servoz

04 Jul, 2023 09:12 AM

When a dependency (dipy) is installed with pip on an appveyor windows build, the installation fails because a module is not installed (packaging).

However, it is installed (in C:\Python37\lib\site-packages).

In fact, when we look at the traceback, we'll notice that at first it's C:\Python37\lib\site-packages that's used, then when we search for the hook, we switch to C:\Users\appveyor\AppData\Local\Temp\1\pip-build-env-en87c6ej\overlay\Lib\site-packages (vide infra), where I think packaging isn't installed.

I don't understand why this is happening and how to fix it.

Collecting dipy (from mia-processes>=2.3.0->populse-mia==2.4.1.dev0+8df8ccf7)
  Downloading dipy-1.7.0.tar.gz (12.4 MB)
     --------------------------------------- 12.4/12.4 MB 29.7 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error
  
  Getting requirements to build wheel did not run successfully.
  exit code: 1
  
  [19 lines of output]
  Traceback (most recent call last):
    File "C:\Python37\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Python37\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Python37\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\appveyor\AppData\Local\Temp\1\pip-build-env-en87c6ej\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "C:\Users\appveyor\AppData\Local\Temp\1\pip-build-env-en87c6ej\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
      self.run_setup()
    File "C:\Users\appveyor\AppData\Local\Temp\1\pip-build-env-en87c6ej\overlay\Lib\site-packages\setuptools\build_meta.py", line 488, in run_setup
      self).run_setup(setup_script=setup_script)
    File "C:\Users\appveyor\AppData\Local\Temp\1\pip-build-env-en87c6ej\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 35, in <module>
    File "C:\Users\appveyor\AppData\Local\Temp\1\pip-install-1nml3j3e\dipy_a5069f489a1242509a5cd4120d68f564\cythexts.py", line 7, in <module>
      from packaging.version import Version
  ModuleNotFoundError: No module named 'packaging'
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
Getting requirements to build wheel did not run successfully.
exit code: 1
See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

13 Apr, 2024 04:43 PM
12 Apr, 2024 04:56 PM
11 Apr, 2024 11:16 PM
09 Apr, 2024 10:59 PM
08 Apr, 2024 07:50 AM

 

06 Apr, 2024 04:06 AM
05 Apr, 2024 01:26 PM
05 Apr, 2024 10:39 AM
04 Apr, 2024 03:41 PM
31 Mar, 2024 05:51 PM
30 Mar, 2024 01:59 PM