我有以下文件夹结构.
application/app/folder/file.py
我想从另一个驻留的Python文件中的file.py中导入一些函数
application/app2/some_folder/some_file.py
我试过了
from application.app.folder.file import func_name
和其他一些尝试,但到目前为止我无法正确导入.我怎样才能做到这一点?
我在Mac上使用'requests'模块时遇到问题.我使用python34并通过pip安装了'requests'模块.我可以通过再次运行安装来验证这一点,它会告诉我已经安装了模块.
15:49:29|mymac [~]:pip install requests
Requirement already satisfied (use --upgrade to upgrade): requests in /opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages
Run Code Online (Sandbox Code Playgroud)
虽然我可以通过交互式Python解释器导入"请求"模块,但尝试在PyCharm中执行"导入请求"会产生错误"无模块命名请求".我检查了我的PyCharm Python解释器设置,并且(我相信)它设置为与我的环境中使用的python34相同.但是,我也看不到PyCharm中列出的"请求"模块.

很明显,我在这里遗漏了一些东西.你们可以建议我应该在哪里看,或者我应该修复什么才能让这个模块正常工作?我的印象是,当我在我的环境中通过pip安装模块时,PyCharm会检测到这些变化.然而,似乎有些事情在我身边被打破了......
我一直在使用PyCharm在PyQt中调试我的gui.到目前为止,这已经非常成功,直到我在尝试调试我的gui时遇到了一个奇怪的错误.我已经在脚本的开头和各个点设置了断点,但程序没有机会达到这一点.我也尝试删除所有断点并运行调试但得到相同的结果.完整的追溯是:
C:\Users\pbreach\Continuum\Anaconda3\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3\helpers\pydev\pydevd.py" --multiproc --qt-support --client 127.0.0.1 --port 53720 --file C:/Users/pbreach/Dropbox/FIDS/cci/bluebook/code/input.py
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3\helpers\pydev\_pydevd_bundle\pydevd_cython_wrapper.py", line 2, in <module>
from _pydevd_bundle.pydevd_cython import trace_dispatch, PyDBAdditionalThreadInfo
ModuleNotFoundError: No module named '_pydevd_bundle.pydevd_cython'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3\helpers\pydev\pydevconsole.py", line 8, in <module>
from code import InteractiveConsole
ImportError: cannot import name 'InteractiveConsole'
During handling of the …Run Code Online (Sandbox Code Playgroud)