简体   繁体   中英

Eclipse pydev project PYTHONPATH with macports python 2.6

I'm using Pydev with Eclipse on Mac. My python interpeter is macports python 2.6.

Right now the python package i'm working on is in my eclipse workspace, but the only way I can get my scripts to run is if I first install it into the macports 2.6 python site_packages folder. This means each time I make a code change I have to uninstall it, and then re-install it for my python interpreter to pick up the change.

How to I tell eclipse to tell python that {workspace}/mypythonporject should be part of the python path environment?

Go to Window > Preferences > PyDev > Interpreter - Python. You should have an interpreter set up. If not, click New and browse to it.

Under Libraries, click New Folder and browse to the directory you want to include. Click Apply, let it build, and try again.

Edit: That is if you want to run the scripts THROUGH Eclipse.

If you want to run them from, say, the command line, you'll need to add the path to your PYTHONPATH environment variable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM