generative-models icon indicating copy to clipboard operation
generative-models copied to clipboard

help! ModuleNotFoundError: No module named 'scripts.demo'

Open tiandaoyuxi opened this issue 1 year ago • 12 comments

无标题 Traceback: File "C:\DATA\generative-models.pt2\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 534, in _run_script exec(code, module.dict) File "C:\DATA\generative-models\scripts\demo\sampling.py", line 3, in from scripts.demo.streamlit_helpers import *

tiandaoyuxi avatar Nov 22 '23 15:11 tiandaoyuxi

same on windows 10

curlysasha avatar Nov 22 '23 15:11 curlysasha

Same on linux

dillfrescott avatar Nov 22 '23 18:11 dillfrescott

set PYTHONPATH=.

that fixes it

dillfrescott avatar Nov 22 '23 18:11 dillfrescott

Setting PYTHONPATH resolved the issue for me as well in Windows 11, but in case anyone else encounters this issue and is using PowerShell, the correct way to do so is as follows:

$ENV:PYTHONPATH=$PWD

This assumes that you're running this command from the generative-models repository directory, of course.

moshferatu avatar Nov 22 '23 19:11 moshferatu

Setting PYTHONPATH resolved the issue for me as well in Windows 11, but in case anyone else encounters this issue and is using PowerShell, the correct way to do so is as follows:

$ENV:PYTHONPATH=$PWD

This assumes that you're running this command from the generative-models repository directory, of course.

This is great and I agree, but I recommend setting the python path to a fixed directory, (the long directory path to the repository)

hammad93 avatar Nov 22 '23 19:11 hammad93

Setting PYTHONPATH resolved the issue for me as well in Windows 11, but in case anyone else encounters this issue and is using PowerShell, the correct way to do so is as follows: $ENV:PYTHONPATH=$PWD This assumes that you're running this command from the generative-models repository directory, of course.

This is great and I agree, but I recommend setting the python path to a fixed directory, (the long directory path to the repository)

But how?)

curlysasha avatar Nov 22 '23 19:11 curlysasha

PYTHONPATH=. streamlit run scripts/demo/video_sampling.py --server.port 8000

yl17104265 avatar Nov 23 '23 01:11 yl17104265

Setting PYTHONPATH resolved the issue for me as well in Windows 11, but in case anyone else encounters this issue and is using PowerShell, the correct way to do so is as follows:

$ENV:PYTHONPATH=$PWD

This assumes that you're running this command from the generative-models repository directory, of course.

THANKS!

tiandaoyuxi avatar Nov 23 '23 02:11 tiandaoyuxi

PYTHONPATH=. streamlit run scripts/demo/video_sampling.py --server.port 8000

Setting PYTHONPATH resolved the issue for me as well in Windows 11, but in case anyone else encounters this issue and is using PowerShell, the correct way to do so is as follows:

$ENV:PYTHONPATH=$PWD

This assumes that you're running this command from the generative-models repository directory, of course.

THANK! it's working…

tiandaoyuxi avatar Nov 23 '23 02:11 tiandaoyuxi

set PYTHONPATH=.

that fixes it I have also encountered this issue in the Linux system. How can I solve it

TuDaCheng avatar Dec 27 '23 13:12 TuDaCheng

set PYTHONPATH=.

that fixes it

This work! on linux shell as : export PYTHONPATH=.

bobby20180331 avatar Jan 12 '24 13:01 bobby20180331

设置 PYTHONPATH 在 Windows 11 中也为我解决了这个问题,但如果其他人遇到此问题并且正在使用 PowerShell,正确的方法如下:

$ENV:PYTHONPATH=$PWD

当然,这假定您是从 generative-models 存储库目录运行此命令的。 03ZFLZM(W()HD32KB1WHT

What's going on with this, I don't quite understand whether it's running in "terminal" or "cmd"?Please help me

lixarcy avatar May 17 '24 07:05 lixarcy