“ImportError: No module named site ” when running sh file from samba shared files

If i try to run this sh file from manjaro own desktop, it works fine. So its no a dependency problem, is it ? But when i access the same sh file shared by an ubuntu desktop using samba, i get this “ImportError: No module named site ”.
I can read, modify and create any files, including this sh file, in the shared folder. So its not a permission issue, right ?
the comand python -c "import site" dosent return anything, so the module is there.
Im using manjaro live, by the way. Its not installed.

The default python on Manjaro/Arch is Python 3.

The default python on Ubuntu/Debian is Python 2.

Hence, it's not the same command and its modules will be different.

1 Like

It dosent seems to be that the case. I just installed manjaro on both machines. The host manjaro has python 3.7.4 , and the live manjaro accessing the files 3.7.2 . iam Sharing the files with samba (https://wiki.manjaro.org/index.php?title=Using_Samba_in_your_File_Manager), as before.
And got the same issue “ImportError: No module named site ”.

Hm. According to https://docs.python.org/3/library/site.html

which probably means something is wrong with your Python script.

The .sh file must be calling a python script. I think the issue is with the python code called - it is using it's script path to load something which is not there.

I don't think the smbclient running on a live Manjaro ISO allows for execution from a samba share.

Try sharing using nfs to share from the Ubuntu machine.

1 Like

Also, seeing the script itself might help if OP wants help debugging the script.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by Bytemark