soraxas / echo360

Commandline tool for automated downloads of echo360 videos hosted by university
https://cs.tinyiu.com/echo360
MIT License
262 stars 51 forks source link

Failed to source virtual environment #12

Closed angeleyes01 closed 5 years ago

angeleyes01 commented 5 years ago

Hello this is my first issue ever :)

I tried to download my course [URL] doing following:

tester@test:~$ ./run.sh https://echo360..........
./run.sh: 43: ./run.sh: source: not found
Failed to source virtual environment

Ich checked run.sh and found the line: source $VENV_NAME/bin/activate || error_exit "Failed to source virtual environment" So it tries to find "$VENV_NAME/bin/activate" but it seems to be not there.

Some more info about my shell:

tester@test:~$  echo $SHELL 
/bin/bash
tester@test:~$ echo $0 
bash

What can I do ?

Information OS: Linux Mint 19 Tara Desktop-Umgebung: Cinnamon Hardware: Thinkpad T460 Kernel: 4.15.0-20-generic

soraxas commented 5 years ago

Hi @angeleyes01 thanks for your issue! :)

After seeing you are using the correct shell, I suspect it might be because of the incorrect shebang that I included in the first line. Can you try to change the first line of run.sh from

#!/bin/sh

to

#!/bin/bash

and see how it goes? Thanks for letting me know!

angeleyes01 commented 5 years ago

thank you for your quick reply :) I did it and now I get:

tester@test ./run.sh https://echo360......
./run.sh: line 43: _echo360venv/bin/activate: No such file or directory
Failed to source virtual environment
soraxas commented 5 years ago

Does that folder contain a folder that named as _echo360venv? If so, try to delete that folder and try again

angeleyes01 commented 5 years ago

it works now !!!! Thank you! Could you explain me what happend? Did it create it in a wrong way first time because I was missing some envirements?

soraxas commented 5 years ago

Yes you are right! When the script first run, it will creates a virtual environment in _echo360venv. But since there were error when you first ran, the folder exists but the virtual environment in fact did not create successfully.

On second (and thereafter) execution the run.sh will detect the folder exists and will not try to re-create the virtual environment again.

Hence, deleting the _echo360venv forces the script to re-create the environment again. I probably would add a helpful hint of informing people try to delete the folder when fail happens.

soraxas commented 5 years ago

Commit b431a7a should have fixed the issue. Let me know if there's anything else!