开发者

Strange PYTHONPATH problem

开发者 https://www.devze.com 2023-02-02 03:51 出处:网络
I recently updated my python installation to 2.7 (previously 2.5), and I\'ve noticed a strange problem where I cannot import certain modules that I created.I had no problem bef开发者_运维百科ore.Norma

I recently updated my python installation to 2.7 (previously 2.5), and I've noticed a strange problem where I cannot import certain modules that I created. I had no problem bef开发者_运维百科ore. Normally, I edit the PYTHONPATH and add the directory I want to import modules. For some strange reason, I can no longer import. I checked my path in PYTHONPATH, and it looked correct.

When I display the sys.path in an interpreter, I see the current directory prepended to every PYTHONPATH entry(i.e. 'c:\blah\blah c:\path\to\module')

If I edit the sys.path by appending the directory that I want at the end of the list,everything works fine(i.e. 'c:\path\to\module\'). I never had to do this before.

I'm on Windows 7 on two computers.

Has anyone else had similar trouble?


Think I found the problem. Somehow I had added the some of the python standard libraries into PYTHONPATH. Once I removed those, everything works fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消