0

I have installed python and numpy,and can run a.py with 'python a.py' command. a.py is here:

import numpy as np
print(np.__version__)

But when I run a.py with command 'sudo nohup python a.py &',no module named numpy. Detail is shown below in image. What's more,my linux version is ubuntu 18_04 64. Detail img

Wargrave Justice
  • 101
  • 1
  • 1
  • 3

1 Answers1

0

The problem is sudo while import works properly as root, check this: PYTHONPATH not working for sudo on GNU/Linux (works for root) may help.

LingSamuel
  • 496
  • 5
  • 10