分享

python下面lib和libs

 易禅浮屠 2021-10-28

如果比较libs/vs.Lib/您会发现后者充满了*.py文件,而前者有*.Lib文件。对文本编辑器的进一步研究将显示*.py文件是人类可读的(我希望如此),而*.lib文件则不是。在

这就是真正的区别。如果您想知道更多的话,.lib文件是静态链接库,用于构建.dll、C扩展名以及所有这些好东西。如果你感兴趣的话,就沿着rabbithole走下去。在

关于你的核心问题:你是否应该能够将模块放入其中并能够导入它们?不是真的。这是包含在您的路径中的文件夹的副作用。从模块docs:When a module named spam is imported, the interpreter first searches

for a built-in module with that name. If not found, it then searches

for a file named spam.py in a list of directories given by the

variable sys.path. sys.path is initialized from these locations:the directory containing the input script (or the current directory).

PYTHONPATH (a list of directory names, with the same syntax as the shell variable PATH).

the installation-dependent default.

各种安装方法都会修改%PATH%或%PYTHONPATH%,所以我无法告诉您确切的查找位置;在我的windows系统中,python安装程序为我修改了%PATH%,所以您可能应该先查看一下。值得注意的是,我的路径不包含Python33/libs/所以我不希望它在默认情况下出现。在

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多