Python Forum
unable to find module in su mode?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unable to find module in su mode?
#1
Hello ,
stange issue
I wrote a code with module "can"
when I run it using this command :

 python3 Documents/ReadData.py
Setup can0 for reading Data
setup finish , waiting for message
it working

when I run it using this command :
 sudo python3 Documents/ReadData.py
Traceback (most recent call last):
  File "Documents/ReadData.py", line 1, in <module>
    import can
ModuleNotFoundError: No module named 'can'
how could it be ?

it's a problem becuse it need to be run as sudo on boot

Thanks,
Reply
#2
sudo can change your path. The specific python those commands are running may be different. You might want to give the full path to python.
Reply
#3
Perhaps you installed the 'can' module for a single user? (with pip install --user)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Program to find Mode of a list PythonBoy 6 999 Sep-12-2023, 09:31 AM
Last Post: PythonBoy
  Pip lists the module but python does not find it Dato 2 1,232 Apr-13-2023, 06:40 AM
Last Post: Dato
  things that work in terminal mode but not in sublime mode alok 4 2,815 Aug-11-2021, 07:02 PM
Last Post: snippsat
  Cannot find module 'torch' ErnestTBass 6 3,543 Oct-13-2020, 05:33 PM
Last Post: ErnestTBass
  Unable to install module rrowhe4d 1 2,254 Oct-13-2020, 10:20 AM
Last Post: Larz60+
  how to find module in installed packages keuninkske 3 3,152 May-09-2020, 10:21 PM
Last Post: keuninkske
  Unable to import my own module ThePhantom 3 2,670 May-01-2020, 01:30 AM
Last Post: menator01
  Unable to find an existing module arbiel 2 4,900 Apr-11-2020, 07:12 PM
Last Post: arbiel
  Unable to write to excel - Using openpyxl module starstud 2 4,382 Feb-05-2020, 03:53 AM
Last Post: starstud
  Pycharm Cannot Find Pygame Module Myang123 2 5,929 Aug-07-2019, 01:26 AM
Last Post: Myang123

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020