python的sys.path_Python的sys.path是从哪里初始化的?

Where is Python's sys.path initialized from?

UPD: Python is adding some paths before refering to PYTHONPATH:

>>> import sys

>>> from pprint import pprint as p

>>> p(sys.path)

['',

'C:\\Python25\\lib\\site-packages\\setuptools-0.6c9-py2.5.egg',

'C:\\Python25\\lib\\site-packages\\orbited-0.7.8-py2.5.egg',

'C:\\Python25\\lib\\site-packages\\morbid-0.8.6.1-py2.5.egg',

'C:\\Python25\\lib\\site-packages\\demjson-1.4-py2.5.egg',

'C:\\Python25\\lib\\site-packages\\stomper-0.2.2-py2.5.egg',

'C:\\Python25\\lib\\site-packages\\uuid-1.30-py2.5.egg',

'C:\\Python25\\lib\\site-packages\\stompservice-0.1.0-py2.5.egg',

'C:\\Python25\\lib\\site-packages\\cherrypy-3.0.1-py2.5.egg',

'C:\\Python25\\lib\\site-packages\\pyorbited-0.2.2-py2.5.egg',

'C:\\Python25\\lib\\site-packages\\flup-1.0.1-py2.5.egg',

'C:\\Python25\\lib\\site-packages\\wsgilog-0.1-py2.5.egg',

'c:\\testdir',

'C:\\Windows\\system32\\python25.zip',

'C:\\Python25\\DLLs',

'C:\\Python25\\lib',

'C:\\Python25\\lib\\plat-win',

'C:\\Python25\\lib\\lib-tk',

'C:\\Python25',

'C:\\Python25\\lib\\site-packages',

'C:\\Python25\\lib\\site-packages\\PIL',

'C:\\Python25\\lib\\site-packages\\win32',

'C:\\Python25\\lib\\site-packages\\win32\\lib',

'C:\\Python25\\lib\\site-packages\\Pythonwin']

My PYTHONPATH is:

PYTHONPATH=c:\testdir

I wonder where those paths before PYTHONPATH's ones come from?

解决方案

"Initialized from the environment variable PYTHONPATH, plus an installation-dependent default"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值