Pip install basicsr | No module named ‘torch’

Hi :wave:

Cant deploy my app because I need ‘basicsr’ but when it’s installing get:

ModuleNotFoundError: No module named 'torch' log file

but i have torch>=1.7 in the requirements.txt

I found this guide BasicSR-INSTALL-local-clone to install it without pip but im not sure how to execute the 3rd step in streamlit cloud and set the value of those variables.

Please run the following commands in the BasicSR root path to install BasicSR:

If you do not need C++ extensions (more details are here):

python setup.py develop

You may also want to specify the CUDA paths:

CUDA_HOME=/usr/local/cuda \
CUDNN_INCLUDE_DIR=/usr/local/cuda \
CUDNN_LIB_DIR=/usr/local/cuda \
BASICSR_EXT=True python setup.py develop

I’m trying with:

print(os.system("ls ./BasicSR/"))
os.system("python BasicSR/setup.py develop")
print("/n/n python BasicSR/setup.py develop /n")

but I get…

Any advice on how to solve the installation with PIP or local? Thanks! :smile:
Repo: GitHub - angelicaba23/app-super-resolution at dev

note: i can import torch in app.py but in BasicSR/setup.py wich is where i use it.

@Ian_Calvert Any advice on how to solve the installation ? i saw the post where you point about the path

Hi @angelicaba23,

When i look at your requirements.txt file it looks like all the instances where you list torch have a # in front of them- so I think that that’s making them a comment and torch is not being installed.

Also, I would clean up your requirements to be just a simple list remove comments, remove packages your not using and make sure every package you need does not have a # in front.

Happy Streamlit-ing!
Marisa

1 Like