HackAfro
HackAfro

Reputation: 720

How do I add the path to a directory to the environment variables using python

I want to know if it is possible to add the path to a directory to the environment variables permanently using python. I have seen other questions that relate to mine but the answers there only add the path temporarily,I want to know if there's a way to add it permanently

Upvotes: 0

Views: 101

Answers (1)

Radhika Jaju
Radhika Jaju

Reputation: 107

While using bash add this ~/.bashrc export PYTHONPATH="${PYTHONPATH}:/Home/dev/path

Make sure the directory you point to has at the topmost init.py file in your directory structure

Upvotes: 1

Related Questions