Quickpost: Adding a Custom Path to Conda Environment

I have a few Python applications in development in a custom ‘projects’ directory. I want to be able to run these using ‘python -m [appname]’.

The easiest way to do this is by adding a .pth file to the site-packages folder of my Python environment (for me ‘/[userdirpath]/anaconda3/envs/[projectname]/lib/python3.5/site-packages/’).

For example, I added a file called ‘custom.pth’ that had one line containing the full path to my ‘projects’ directory. I can then import the apps.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s