Jump to content

Hello,

I have some modules in a folder in dropbox which is downloaded in my phone. I want to add that location permanently to the PYTHONPATH so that I can call them whenever I want.

But I am unable to do that.
 

Things I tried.

import sys
import site
site.addsitedir('the path')
print(sys.path)

This was only temporary.

 

2. In pydroid terminal..

export PYTHONPATH = "$PYTHONPATH: the path"


Any help will be much appreciated.

P.S: I don't want to move these files to any other folder as because I want to have a direct connection to my PC where Dropbox folder is added to the pythonpath.

Link to post
Share on other sites

  • 2 years later...

Old thread I know... But my workaround for this issue was to go into Settings->System and change "Interpreter name" to something like this

python3 -i **path to script**

Create a startup script similar to this

import sys
sys.path.append(**path to modules**)

Running python with -i forces an interactive session instead of exiting after the script runs.

 

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

×