Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to undo sys.path.append(pathToModule)

I have been trying to fix the python path on my cpu, and I originally was just trying to change my .bash_profile, but that wasn't working, so I used

import sys
sys.pat.append(path/To/Module)

and now when I run my script, I get this error message

How can I either fix this issue or undo the sys.path.append(path/To/Module)?

Also, is it possible to export multiple directories in the python path, and if so how do I do that?

like image 854
SUPhys Avatar asked Oct 31 '22 01:10

SUPhys


1 Answers

Note that if you add a path with sys.path.append() you do this only for the current session. No need to undo it.

Just remove the line from you python file.

like image 52
Ivonet Avatar answered Nov 02 '22 11:11

Ivonet