Python works in PyCharm but not from terminal

后端 未结 7 803
你的背包
你的背包 2020-12-31 03:06

I recently figured out how to import modules for unittesting in python. As a solution to this, I use:

sys.path.append(os.path.abspath(os.path.join(os.path.di         


        
7条回答
  •  轮回少年
    2020-12-31 03:45

    I too have had this issue - and the PYTHONPATH setting set by PyCharm did seem to be the issue.

    My alternative (as I was nearly finished writing the code) was to generate a setup.py - and install the classes/structure in my local virtual python environment.

    Hope this helps..

提交回复
热议问题