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

run.bat does not execute #42

Open
huru0510 opened this issue Jun 16, 2024 · 4 comments
Open

run.bat does not execute #42

huru0510 opened this issue Jun 16, 2024 · 4 comments

Comments

@huru0510
Copy link

After I install the setup.bat and the venv folder appears, I click on run.bat and the command window briefly opens and closes.

Is there any solution to this problem?

@Zach-Wendt
Copy link

Had this same problem.

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last): File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\cam.py", line 1, in <module>
import cv2
File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\venv\Lib\site-packages\cv2_init_.py", line 181, in <module>
bootstrap()
File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\venv\Lib\site-packages\cv2_init_.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "C:\Users\blah\AppData\Local\Programs\Python\Python311\Lib\importlib_init_.py", line 126, in import_module
return bootstrap.gcd_import(name[level:], package, level)
AttributeError: ARRAY_API not found
Traceback (most recent call last):
File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\cam.py", line 1, in <module>
import cv2
File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\venv\Lib\site-packages\cv2_init.py", line 181, in <module>
bootstrap()
File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\venv\Lib\site-packages\cv2_init.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\blah\AppData\Local\Programs\Python\Python311\Lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: numpy.core.multiarray failed to import

I had to navigate to the run.bat location and activate the venv

# open cmd, navigate to ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam directory
# this call command below activated the venv for me
call .\venv\Scripts\activate.bat python cam.py

Run

pip install numpy==1.23.5

Then

pip install --force-reinstall -r requirements.txt

This ended up not working so I finally ran:

pip install --upgrade opencv-python pillow mttkinter mss pywin32 pysimplegui pygrabber keyboard pygetwindow

And it worked! Good luck!

@toyxyz
Copy link
Owner

toyxyz commented Jun 18, 2024

I fixed the problem, try updating to the latest version!

@amocarski
Copy link

amocarski commented Sep 9, 2024

@Zach-Wendt I don;t quite understand this step, shall I run something inside this directory?

# this call command below activated the venv for me
call .\venv\Scripts\activate.bat python cam.py```

@IgorCulafic
Copy link

For anyone struggling with the call command it is only for CDM and not Shell.

Go to the ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\venv\Scripts folder, right click and open shell from there and type the following. You can also cd into the dir.

.\Activate.ps1

The rest is the same.

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

5 participants