Jump to content

Python3 permanently remove path from sys.path

Joveice

I got this path that's my repo location and I want to remove it. sys.path.remove(path) works, but if I open a new python session it's back.. :P

 

What can I do here?

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Meic said:

Are you using linux or windows?

Linux, Fedora.

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

if you type 

echo $PATH

do you see the location in there?

 

 

Paths can be set in multiple places in Linux. I would check for anywhere in your ~/.bashrc , ~/.profile , ~/.interactive for a line like:
PATH=$PATH:<dir you don't want in path>

and remove it.

 

Link to comment
Share on other sites

Link to post
Share on other sites

38 minutes ago, Meic said:

if you type 


echo $PATH

do you see the location in there?

 

 

Paths can be set in multiple places in Linux. I would check for anywhere in your ~/.bashrc , ~/.profile , ~/.interactive for a line like:
PATH=$PATH:<dir you don't want in path>

and remove it.

 

It's not in $PATH, $PYTHONPATH, bashrc or profile :P

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

python3 -m pip install -e . --user
python3 -m pip uninstall <mypackage>

This for some reason works, a pip uninstall directly said there was nothing to uninstall :P

 

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

40 minutes ago, Joveice said:

python3 -m pip install -e . --user
python3 -m pip uninstall <mypackage>

This for some reason works, a pip uninstall directly said there was nothing to uninstall :P

That's rather weird! Glad you got it working :)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×