[英]Add directory to Python path in PyCharm?
I want to be able to use the paraview.simple
library in PyCharm.我希望能够在 PyCharm 中使用
paraview.simple
库。 I already have paraview installed in my computer.我的电脑上已经安装了paraview。 This package cannot be installed with
pip
and there are no .whl files as far as I can tell.这个包不能用
pip
安装,据我所知没有 .whl 文件。 The website docs recommend that the directory containing all the python files be added to PYTHONPATH.网站文档建议将包含所有 python 文件的目录添加到 PYTHONPATH。
How do I add the relevant folder in PYTHONPATH on my PyCharm session, and keep it there by default, such that when I close out and reopen the paraview.simple
library is still available?如何在 PyCharm 会话的 PYTHONPATH 中添加相关文件夹,并默认将其保留在那里,以便当我关闭并重新打开
paraview.simple
库时仍然可用?
You can add custom paths this way.您可以通过这种方式添加自定义路径。
In PyCharm version 2020.3.1 use the following workflow instead (see official docs ):在 PyCharm 版本 2020.3.1 中,请改用以下工作流程(请参阅官方文档):
Ctrl+Alt+S - open Settings. Ctrl+Alt+S - 打开设置。
File|Settings|Project|Project Structure...文件|设置|项目|项目结构...
You will see project folder structure.您将看到项目文件夹结构。 Mark subfolders as Sources or Excluded
将子文件夹标记为来源或排除
conda install -c conda-forge paraview
conda install -c conda-forge paraview
For me this solved it: mapping the local path to the remote inside the Pycharm run configurations settings.对我来说,这解决了它:在 Pycharm 运行配置设置中将本地路径映射到远程。
Edit Configurations > Path Mappings >编辑配置 > 路径映射 >
Local path = /<Users/me/pycharm etc.../project root> remote path = /本地路径 = /<Users/me/pycharm etc.../project root> 远程路径 = /
eg.例如。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.