landing-ai / vision-agent

Vision agent
Apache License 2.0
4.73k stars 536 forks source link

Issue trying to pip install vision-agent #413

Closed phitrti closed 3 weeks ago

phitrti commented 1 month ago

Setup / Installation question.

I'm trying to set up the python environment on the Mac for VS Code. I tried just:

python3 -m pip install vision-agent

But it gave me errors around build wheel. Doing a bit of digging, I then did:

brew install pkg-config brew install ffmpeg python3 -m pip install vision-agent

And got further. I'm having an issue with pillow-heif I think. I tried brew install x265 libjpeg libde265 libheif based on some information on their website but that didn't fix the issue.

I'm using python 3.13.2. Here is the error I'm getting:

Collecting pillow-heif<0.17.0,>=0.16.0 (from vision-agent) Using cached pillow_heif-0.16.0.tar.gz (14.9 MB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [24 lines of output] Traceback (most recent call last): File "/Users/reckhoff/Desktop/MyProjects_Local/development/python/Sigma+Sight/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in main()


        File "/Users/reckhoff/Desktop/MyProjects_Local/development/python/Sigma+Sight/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/reckhoff/Desktop/MyProjects_Local/development/python/Sigma+Sight/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/mf/4f689rp94r18qbj4ncsx1z140000gn/T/pip-build-env-yl6f9dtn/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/mf/4f689rp94r18qbj4ncsx1z140000gn/T/pip-build-env-yl6f9dtn/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/private/var/folders/mf/4f689rp94r18qbj4ncsx1z140000gn/T/pip-build-env-yl6f9dtn/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/mf/4f689rp94r18qbj4ncsx1z140000gn/T/pip-build-env-yl6f9dtn/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 273, in <module>
        File "<string>", line 29, in get_version
      KeyError: '__version__'
      [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.

Any ideas how to resolve?
lai-bianca commented 1 month ago

Hi @phitrti , sorry to hear that you're experiencing issues setting up the environment. One of our developers put together this beginner-friendly guide for setting up VisionAgent. I recommend following these instructions to see if you can get unstuck. Let us know how it goes!

phitrti commented 1 month ago

Thanks @lai-bianca for the quick response. Any chance you have details for a python venv setup? I was hoping to avoid conda or miniconda as the target environment already exists as python venv. Or a list of the required libraries and packages that are needed that I need to install manually?

lai-bianca commented 1 month ago

Hi @phitrti, here's a set of instructions for using a venv setup: https://short-germanium-d7b.notion.site/Initial-setup-with-Python-venv-1ba8c6d3ef4c8073a0dccb6c55e73efd

We haven't tested this procedure yet, so please let us know if you hit any roadblocks or have any edits.

phitrti commented 1 month ago

The venv instructions are pretty much the same as what I did. This morning, I tried again from scratch and get the same error. I'm running Python 3.13.2. Is there maybe a back dependency where I need to use Python 3.10. The instructions say Python 3.10 but the github page says anything over 3.9 should be fine. That is the only difference I can find.

Side question: I've been using github as the source for visionagent documentation like installation but in your responses above, you are pointing to a different website. Is there a documentation library for visionagent I should be looking at beyond github?

Here is the full output of what I did and I get the same error. Let me know if you think I should try down leveling to 3.10 for this.

Last login: Thu Apr 10 07:07:33 on ttys001 reckhoff@RTI-109081 visionagenttest % python3 --version Python 3.13.2 reckhoff@RTI-109081 visionagenttest % python3 -m venv va reckhoff@RTI-109081 visionagenttest % source va/bin/activate (va) reckhoff@RTI-109081 visionagenttest % pip install vision-agent Collecting vision-agent Using cached vision_agent-1.1.1-py3-none-any.whl.metadata (12 kB) Collecting anthropic<0.32.0,>=0.31.0 (from vision-agent) Using cached anthropic-0.31.2-py3-none-any.whl.metadata (18 kB) Collecting av<12.0.0,>=11.0.0 (from vision-agent) Using cached av-11.0.0.tar.gz (3.7 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting dotenv<0.10.0,>=0.9.9 (from vision-agent) Using cached dotenv-0.9.9-py2.py3-none-any.whl.metadata (279 bytes) Collecting flake8<8.0.0,>=7.0.0 (from vision-agent) Using cached flake8-7.2.0-py2.py3-none-any.whl.metadata (3.8 kB) Collecting ipykernel<7.0.0,>=6.29.4 (from vision-agent) Using cached ipykernel-6.29.5-py3-none-any.whl.metadata (6.3 kB) Collecting libcst<2.0.0,>=1.5.0 (from vision-agent) Using cached libcst-1.7.0-cp313-cp313-macosx_11_0_arm64.whl.metadata (17 kB) Collecting matplotlib<4.0.0,>=3.9.2 (from vision-agent) Using cached matplotlib-3.10.1-cp313-cp313-macosx_11_0_arm64.whl.metadata (11 kB) Collecting nbclient<0.11.0,>=0.10.0 (from vision-agent) Using cached nbclient-0.10.2-py3-none-any.whl.metadata (8.3 kB) Collecting nbformat<6.0.0,>=5.10.4 (from vision-agent) Using cached nbformat-5.10.4-py3-none-any.whl.metadata (3.6 kB) Collecting numpy<2.0.0,>=1.21.0 (from vision-agent) Using cached numpy-1.26.4.tar.gz (15.8 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting openai==1. (from vision-agent) Using cached openai-1.72.0-py3-none-any.whl.metadata (25 kB) Collecting opencv-python==4. (from vision-agent) Using cached opencv_python-4.11.0.86-cp37-abi3-macosx_13_0_arm64.whl.metadata (20 kB) Collecting opentelemetry-api<2.0.0,>=1.29.0 (from vision-agent) Using cached opentelemetry_api-1.31.1-py3-none-any.whl.metadata (1.6 kB) Collecting pandas==2. (from vision-agent) Using cached pandas-2.2.3-cp313-cp313-macosx_11_0_arm64.whl.metadata (89 kB) Collecting pillow==10. (from vision-agent) Using cached pillow-10.4.0-cp313-cp313-macosx_11_0_arm64.whl.metadata (9.2 kB) Collecting pillow-heif<0.17.0,>=0.16.0 (from vision-agent) Using cached pillow_heif-0.16.0.tar.gz (14.9 MB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [24 lines of output] Traceback (most recent call last): File "/Users/reckhoff/Desktop/MyProjects_Local/development/python/visionagenttest/va/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in main()


        File "/Users/reckhoff/Desktop/MyProjects_Local/development/python/visionagenttest/va/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/reckhoff/Desktop/MyProjects_Local/development/python/visionagenttest/va/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/mf/4f689rp94r18qbj4ncsx1z140000gn/T/pip-build-env-oapqoyoc/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/mf/4f689rp94r18qbj4ncsx1z140000gn/T/pip-build-env-oapqoyoc/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/private/var/folders/mf/4f689rp94r18qbj4ncsx1z140000gn/T/pip-build-env-oapqoyoc/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/mf/4f689rp94r18qbj4ncsx1z140000gn/T/pip-build-env-oapqoyoc/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 273, in <module>
        File "<string>", line 29, in get_version
      KeyError: '__version__'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 25.0 -> 25.0.1
[notice] To update, run: pip install --upgrade 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.
(va) reckhoff@RTI-109081 visionagenttest % 
cmaloney111 commented 1 month ago

Hi @phitrti

At the moment, it appears that the vision-agent repository only allows pillow-heif versions in the following format: 0.16.*

However, the first pillow-heif version that is compatible with Python 3.13 is 0.17.0. As a temporary fix, you could change the line in the pyproject.toml file that defines the pillow-heif version from:

pillow-heif = "^0.16.0"

to

pillow-heif = "^0.17.0"

And it should work now. This is just a temporary fix, but the underlying issue should be resolved soon.

phitrti commented 1 month ago

Where does pyproject.toml live for me to edit? I find one in a python3 example folder but none appear in any venv folders.

-Randy

From: Cameron Maloney @.> Date: Thursday, April 10, 2025 at 8:18 AM To: landing-ai/vision-agent @.> Cc: [Technology] PHIT @.>, Mention @.> Subject: Re: [landing-ai/vision-agent] Issue trying to pip install vision-agent (Issue #413) EXTERNAL: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hi @phitrtihttps://github.com/phitrti

At the moment, it appears that the vision-agent repository only allows pillow-heif versions in the following format: 0.16.*

However, the first pillow-heif version that is compatible with Python 3.13 is 0.17.0. As a temporary fix, you could change the line in the pyproject.toml file that defines the pillow-heif version from:

pillow-heif = "^0.16.0"

to

pillow-heif = "^0.17.0"

And it should work now. This is just a temporary fix, but the underlying issue should be resolved soon.

— Reply to this email directly, view it on GitHubhttps://github.com/landing-ai/vision-agent/issues/413#issuecomment-2792549845, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFCUWSGMW7WVOUFKIDNJO6D2YZOPLAVCNFSM6AAAAAB2ZQCUMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOJSGU2DSOBUGU. You are receiving this because you were mentioned.Message ID: @.***> [Image removed by sender.]cmaloney111 left a comment (landing-ai/vision-agent#413)https://github.com/landing-ai/vision-agent/issues/413#issuecomment-2792549845

Hi @phitrtihttps://github.com/phitrti

At the moment, it appears that the vision-agent repository only allows pillow-heif versions in the following format: 0.16.*

However, the first pillow-heif version that is compatible with Python 3.13 is 0.17.0. As a temporary fix, you could change the line in the pyproject.toml file that defines the pillow-heif version from:

pillow-heif = "^0.16.0"

to

pillow-heif = "^0.17.0"

And it should work now. This is just a temporary fix, but the underlying issue should be resolved soon.

— Reply to this email directly, view it on GitHubhttps://github.com/landing-ai/vision-agent/issues/413#issuecomment-2792549845, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFCUWSGMW7WVOUFKIDNJO6D2YZOPLAVCNFSM6AAAAAB2ZQCUMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOJSGU2DSOBUGU. You are receiving this because you were mentioned.Message ID: @.***>

ankit1khare commented 1 month ago

@phitrti You won’t find it in your venv because it exists only:

In the original package repo (if cloning manually), or in a temp build folder during pip install from source.

Could you please try using python 3.10 or 3.11? This is happening deep inside the setup.py or pyproject.toml of the dependency — it doesn’t recognize Python 3.13 yet. This is pretty common for newer Python versions that upstream packages haven’t caught up to.