
我正在使用DVCS,所以当我想修复错误或向库中添加一个功能时,我会创建一个存储库的分支并在该分支内工作.要使用我对库进行的更改来测试我的应用程序,我编辑“mylib.pth”中的路径以指向新的开发分支.
如果我的库中有一些并行分支,那么这会变得有点乏味.我必须在测试之前继续编辑“mylib.pth”文件,以确保我正在测试我的库的正确版本.有没有办法使用当前路径(即我当前的库的开发分支)来设置我调用应用程序时的库路径,而不是使用全局“site-packages”中的“mylib.pth”目录?
解决方法 您要找的是 virtualenv吗?从描述:总结Imagine you have an application that needs version 1 of libFoo,but another application requires version 2. How can you use both these applications? If you install everything into /usr/lib/python2.4/site-packages (or whatever your platform’s standard location is),it’s easy to end up in a situation where you unintentionally upgrade an application that shouldn’t be upgraded.
以上是内存溢出为你收集整理的在开发库模块时设置Python路径全部内容,希望文章能够帮你解决在开发库模块时设置Python路径所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)