Stability-AI / generative-models

Generative Models by Stability AI
MIT License
24.24k stars 2.7k forks source link

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

Open tiandaoyuxi opened 10 months ago

tiandaoyuxi commented 10 months ago

无标题 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 *

curlysasha commented 10 months ago

same on windows 10

dillfrescott commented 10 months ago

Same on linux

dillfrescott commented 10 months ago

set PYTHONPATH=.

that fixes it

moshferatu commented 10 months ago

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.

hammad93 commented 10 months ago

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)

curlysasha commented 10 months ago

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?)

yl17104265 commented 10 months ago

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

tiandaoyuxi commented 10 months ago

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 commented 10 months ago

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…

TuDaCheng commented 9 months ago

set PYTHONPATH=.

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

bobby20180331 commented 8 months ago

set PYTHONPATH=.

that fixes it

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

lixarcy commented 4 months ago

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

$ENV:PYTHONPATH=$PWD

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

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