Deep-Live-Cam icon indicating copy to clipboard operation
Deep-Live-Cam copied to clipboard

It works the first time and the second time it show -No module named "torch"-

Open StreamHubHub opened this issue 1 year ago • 9 comments

After trying many ways to install Face Cam Live, because allways it showed "No module named torch" when i ran it, i was able to make it work, I had to install pytorch before everything else, but now, after the full instalation, face cam live works in it first run, but when i close it and i try run it again, it showed again "No module named torch" and i need to delete all and install all again.

Does anybody know how can i fix this?

I installed pytorch cuda

StreamHubHub avatar Aug 15 '24 07:08 StreamHubHub

Make sure to work on a virtual environment. Also, try to run the program with "python3 run.py ....." instead of "python run.py".

e-basaran avatar Aug 15 '24 09:08 e-basaran

Make sure to work on a virtual environment. Also, try to run the program with "python3 run.py ....." instead of "python run.py".

Well I dont know how related this problem is but I got something similar but my program never worked

where torch, tensorflow, cv2 & customtkinter modules where not found when running python run.py --execution-provider cuda

i installed torch & customtkinter with pip but cv2 isnt found

G-Titan avatar Aug 16 '24 12:08 G-Titan

Make sure to work on a virtual environment. Also, try to run the program with "python3 run.py ....." instead of "python run.py".

Well I dont know how related this problem is but I got something similar but my program never worked

where torch, tensorflow, cv2 & customtkinter modules where not found when running python run.py --execution-provider cuda

i installed torch & customtkinter with pip but cv2 isnt found

Did you use "pip install -r requirements.txt" to install dependencies? If not, please use it in a new virtual environment to avoid conflicting.

e-basaran avatar Aug 16 '24 14:08 e-basaran

can you please teach me how to do that? or at least send me a youtube tutorial link please.

Saadx45 avatar Aug 17 '24 08:08 Saadx45

Make sure to work on a virtual environment. Also, try to run the program with "python3 run.py ....." instead of "python run.py".

Well I dont know how related this problem is but I got something similar but my program never worked where torch, tensorflow, cv2 & customtkinter modules where not found when running python run.py --execution-provider cuda i installed torch & customtkinter with pip but cv2 isnt found

Did you use "pip install -r requirements.txt" to install dependencies? If not, please use it in a new virtual environment to avoid conflicting.

Well, I did run "pip install -r requirements.txt", but it fails with that kind of output:

import pkg_resources File "/private/var/folders/d7/pgrpwgdj29jgx9fy9l8f0by80000gn/T/pip-build-env-g725ehqt/overlay/lib/python3.12/site-packages/pkg_resources/init.py", line 2172, in register_finder(pkgutil.ImpImporter, find_on_path) ^^^^^^^^^^^^^^^^^^^ AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'? [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.

Sagrido avatar Aug 19 '24 02:08 Sagrido

You should downgrade Python from 3.12 to 3.10

On Mon, 19 Aug 2024 at 05:31, Sagrido @.***> wrote:

Make sure to work on a virtual environment. Also, try to run the program with "python3 run.py ....." instead of "python run.py".

Well I dont know how related this problem is but I got something similar but my program never worked where torch, tensorflow, cv2 & customtkinter modules where not found when running python run.py --execution-provider cuda i installed torch & customtkinter with pip but cv2 isnt found

Did you use "pip install -r requirements.txt" to install dependencies? If not, please use it in a new virtual environment to avoid conflicting.

Well, I did run "pip install -r requirements.txt", but it fails with that kind of output:

import pkg_resources File "/private/var/folders/d7/pgrpwgdj29jgx9fy9l8f0by80000gn/T/pip-build-env-g725ehqt/overlay/lib/python3.12/site-packages/pkg_resources/ init.py", line 2172, in register_finder(pkgutil.ImpImporter, find_on_path) ^^^^^^^^^^^^^^^^^^^ AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'? [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 email directly, view it on GitHub https://github.com/hacksider/Deep-Live-Cam/issues/331#issuecomment-2295552743, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVJOBSTW2QDWNZM5WLLUKNTZSFKGHAVCNFSM6AAAAABMRXG4AOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGU2TENZUGM . You are receiving this because you commented.Message ID: @.***>

e-basaran avatar Aug 19 '24 08:08 e-basaran

You should downgrade Python from 3.12 to 3.10 On Mon, 19 Aug 2024 at 05:31, Sagrido @.> wrote: Make sure to work on a virtual environment. Also, try to run the program with "python3 run.py ....." instead of "python run.py". Well I dont know how related this problem is but I got something similar but my program never worked where torch, tensorflow, cv2 & customtkinter modules where not found when running python run.py --execution-provider cuda i installed torch & customtkinter with pip but cv2 isnt found Did you use "pip install -r requirements.txt" to install dependencies? If not, please use it in a new virtual environment to avoid conflicting. Well, I did run "pip install -r requirements.txt", but it fails with that kind of output: import pkg_resources File "/private/var/folders/d7/pgrpwgdj29jgx9fy9l8f0by80000gn/T/pip-build-env-g725ehqt/overlay/lib/python3.12/site-packages/pkg_resources/ init.py", line 2172, in register_finder(pkgutil.ImpImporter, find_on_path) ^^^^^^^^^^^^^^^^^^^ AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'? [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 email directly, view it on GitHub <#331 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVJOBSTW2QDWNZM5WLLUKNTZSFKGHAVCNFSM6AAAAABMRXG4AOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGU2TENZUGM . You are receiving this because you commented.Message ID: @.>

That actually solved it! Thanks! Dependencies are not downloading for me.

Sagrido avatar Aug 19 '24 08:08 Sagrido

You're welcome!

On Mon, 19 Aug 2024 at 11:36, Sagrido @.***> wrote:

You should downgrade Python from 3.12 to 3.10 … <#m_1088914357476347581_> On Mon, 19 Aug 2024 at 05:31, Sagrido @.> wrote: Make sure to work on a virtual environment. Also, try to run the program with "python3 run.py ....." instead of "python run.py". Well I dont know how related this problem is but I got something similar but my program never worked where torch, tensorflow, cv2 & customtkinter modules where not found when running python run.py --execution-provider cuda i installed torch & customtkinter with pip but cv2 isnt found Did you use "pip install -r requirements.txt" to install dependencies? If not, please use it in a new virtual environment to avoid conflicting. Well, I did run "pip install -r requirements.txt", but it fails with that kind of output: import pkg_resources File "/private/var/folders/d7/pgrpwgdj29jgx9fy9l8f0by80000gn/T/pip-build-env-g725ehqt/overlay/lib/python3.12/site-packages/pkg_resources/ init.py", line 2172, in register_finder(pkgutil.ImpImporter, find_on_path) ^^^^^^^^^^^^^^^^^^^ AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'? [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 email directly, view it on GitHub <#331 (comment) https://github.com/hacksider/Deep-Live-Cam/issues/331#issuecomment-2295552743>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVJOBSTW2QDWNZM5WLLUKNTZSFKGHAVCNFSM6AAAAABMRXG4AOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGU2TENZUGM https://github.com/notifications/unsubscribe-auth/AVJOBSTW2QDWNZM5WLLUKNTZSFKGHAVCNFSM6AAAAABMRXG4AOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGU2TENZUGM . You are receiving this because you commented.Message ID: @.>

That actually solved it! Thanks! Dependencies are not downloading for me.

— Reply to this email directly, view it on GitHub https://github.com/hacksider/Deep-Live-Cam/issues/331#issuecomment-2295993782, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVJOBSTFYYOPDJGFZX5ZTOLZSGVCPAVCNFSM6AAAAABMRXG4AOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVHE4TGNZYGI . You are receiving this because you commented.Message ID: @.***>

e-basaran avatar Aug 19 '24 13:08 e-basaran

I'm using Macbook Air M2 and experienced this error when running ython run.py --execution-provider coreml: Traceback (most recent call last): File "/Users/xxx/Documents/Github/Deep-Live-Cam/run.py", line 3, in from modules import core File "/Users/xxx/Documents/Github/Deep-Live-Cam/modules/core.py", line 14, in import torch ModuleNotFoundError: No module named 'torch'

I am using venv

curious-itauditor avatar Aug 21 '24 11:08 curious-itauditor