zoukankan      html  css  js  c++  java
  • pycharm PYTHONPATH

    Hi brandenju! I believe os.chdir doesn't affect PYTHONPATH so changing your working directory at runtime to resolve imports make little sense. One can edit PYTHONPATH with sys.path object if needed.

    PyCharm refuse to read it

    Could you please specify what exactly happened? Do you receive an unresolved reference error, ImportError during the runtime or both?

    it's in my current directory

    Is this directory a project root? If it's not then the problem seems to be clear - when running a file in the terminal your current working directory is added to the PYTHONPATH, this is not the case in PyCharm - by default, only the project root is added to PYTHONPATH. The basic workaround here is to mark lr_utils.py folder as Sources Root by right click in the Project window.

    All source roots are added to PYTHONPATH.

  • 相关阅读:
    高级查询相关练习
    高级查询
    CRUD简单查询
    eclipse 实际运用
    控制台输入与Math Random的基本使用
    调用方法
    jQuery 基础语法
    Java第二课 分支与循环
    Java第一课
    网页项目制作收获2
  • 原文地址:https://www.cnblogs.com/ExMan/p/10432734.html
Copyright © 2011-2022 走看看