Skip to content

ImportError: cannot import name 'packaging' from 'pkg_resources' #1

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

Closed
cyy536 opened this issue Jul 14, 2024 · 0 comments
Closed

ImportError: cannot import name 'packaging' from 'pkg_resources' #1

cyy536 opened this issue Jul 14, 2024 · 0 comments

Comments

@cyy536
Copy link

cyy536 commented Jul 14, 2024

I need some help!!!

Error

I follow the instructions to install the modified MuxServe-vLLM from source, it failed when i "pip install -e .".

(muxserve) root@x299aii:~/MuxServe-vLLM# pip install -e .
Obtaining file:///root/MuxServe-vLLM
  Installing build dependencies ... |
done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... error
  error: subprocess-exited-with-error

  × Getting requirements to build editable did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      Traceback (most recent call last):
        File "/root/miniconda3/envs/muxserve/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/root/miniconda3/envs/muxserve/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/root/miniconda3/envs/muxserve/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 132, in get_requires_for_build_editable
          return hook(config_settings)
        File "/tmp/pip-build-env-dw39k1oa/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 458, in get_requires_for_build_editable
          return self.get_requires_for_build_wheel(config_settings)
        File "/tmp/pip-build-env-dw39k1oa/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "/tmp/pip-build-env-dw39k1oa/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-dw39k1oa/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 11, in <module>
        File "/tmp/pip-build-env-dw39k1oa/overlay/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 25, in <module>
          from pkg_resources import packaging  # type: ignore[attr-defined]
      ImportError: cannot import name 'packaging' from 'pkg_resources' (/tmp/pip-build-env-dw39k1oa/overlay/lib/python3.9/site-packages/pkg_resources/__init__.py)
      [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 editable 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.

Try but failed

And i search the Internet and try the suggestion in AUTOMATIC1111/stable-diffusion-webui#15863 and aws-neuron/aws-neuron-sdk#893. They suggest to "pip install setuptools==69.5.1". But it still failed for me.

(muxserve) root@x299aii:~/MuxServe-vLLM# pip show setuptools
Name: setuptools
Version: 69.5.1
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: https://github.com/pypa/setuptools
Author: Python Packaging Authority
Author-email: [email protected]
License:
Location: /root/miniconda3/envs/muxserve/lib/python3.9/site-packages
Requires:
Required-by:

System information

(muxserve) root@x299aii:~/MuxServe-vLLM# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"
(muxserve) root@x299aii:~/MuxServe-vLLM# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Mon_Apr__3_17:16:06_PDT_2023
Cuda compilation tools, release 12.1, V12.1.105
Build cuda_12.1.r12.1/compiler.32688072_0
(muxserve) root@x299aii:~/MuxServe-vLLM# conda --version
conda 24.5.0

I wonder whether someone know how to fix it, i would appreciate it very much!!!

@cyy536 cyy536 closed this as completed Jul 14, 2024
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

1 participant