问题标签 [pymatgen]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
306 浏览

python - Google Colab 在安装 pymatgen 时显示错误

我正在尝试通过以下命令在 Google colab 中安装 pymatgen:

这会引发以下错误:

尝试使用以下方式安装:

这会引发以下错误:

请帮助解决这个问题。

0 投票
1 回答
76 浏览

python - 保存/存储 pymatgen 结构

我目前正在处理一个包含各种信息的材料科学数据集。

特别是,我有一个包含多个pymatgen.core.Structure对象的“结构”列。

我想将此数据集保存/存储为.csv文件或类似文件,但问题是在完成此操作并重新打开后,pymatgen 结构失去了它们type成为格式化字符串的状态,我无法恢复到它们的初始pymatgen.core.Structure数据类型。

关于如何做到这一点的任何提示?我正在搜索pymatgen文档,但现在还没有幸运..

提前致谢!

0 投票
1 回答
351 浏览

python - Anaconda python 3.8 的 Pymatgen 安装问题?未找到 Monty 模块?

我渴望开始使用材料模拟。我在尝试使用 Anaconda 安装 Pymatgen 时遇到问题。这是我做的事情。我正在使用 Win 8.1 x64、Python 3.8。

  1. 首先,我尝试通过命令提示符使用“conda install -c conda-forge pymatgen”安装Pymatgen v2022.0.8 。它抛出了一个错误,但它仍然运行了很长时间。根据stackoverflow中类似问题的一些评论,我什至在安装spglib 1.16.0后尝试安装它。
  2. 我停止了它,发现 anaconda 站点包文件夹中没有安装任何东西。 Pymatgen_cmd_error.JPG
  3. 于是我下载了“win-64/pymatgen-2022.0.8-py38hbd9d945_0.tar.bz2”并手动安装。 Pymatgen_cmd_manual_installation.JPG
  4. 当我试图运行一个测试程序时,它抛出了一个错误“ModuleNotFoundError: No module named 'monty'”Pymatgen_run_error.JPG
  5. 所以我尝试使用 cmd promt 'conda install -c conda-forge monty' 从 Anaconda 安装 'monty'。再次报错,提示“环境不一致,请仔细查看套餐方案,以下套餐造成了不一致。” Pymatgen_cmd_monty_error.JPG
  6. 我尝试从 Anaconda 手动安装“Monty”,但没有可用的 Win x64 Py3.8 软件包。

我在网上找不到任何解决方案来诊断问题。如果有人可以分享一些时间和想法来克服它,那就太好了。这将极大地帮助我加快材料模拟工作的进展。先感谢您。

0 投票
0 回答
44 浏览

python - Pymatgen:无法将 enum.x 和 makeStr.py 添加到路径

我正在尝试MagneticStructureEnumerator在 pymatgen 中运行该课程。为此,我已将 enum.x 和 makeStr.py 安装到我在 anaconda 中的路径中。但是,我仍然收到此错误:

我该如何解决这个问题?

0 投票
1 回答
183 浏览

python - ImportError:无法从“pymatgen”(未知位置)导入名称“分子”

我正在尝试在 Anaconda3 中使用“pymatgen”模拟 Si 晶体结构。

此代码运行没有错误。但是当我运行以下代码时-

它给出错误“ImportError: cannot import name 'Molecule' from 'pymatgen' (unknown location)”这发生在所有其他模块上。我该如何解决这个问题?

0 投票
0 回答
20 浏览

python - 如何访问存储在单独环境中的python库?

对于我的项目,我使用的是 Pymatgen 库。我已经将它安装在一个单独的环境中作为“my_pymatgen”。现在,在使用import pymatgen命令期间它给出了错误ModuleNotFoundError。如何访问这个库?

0 投票
0 回答
20 浏览

python - 如何使用 Pymatgen 模拟 SiO2?

我想使用 pymatgen 对 SiO2 结构进行建模。它是一个三角结构,晶格常数为 5.4052,角度均等于 75。空间群为 154。当我将这些值放入 pymatgen 时,它给出了值错误。

提供的带有参数(5.4052、5.4052、5.4052、75.00000000000001、75.00000000000001、75.00000000000001)的晶格与提供的空间群 P6_3cm 不兼容!

空间群应该是什么?如何模拟 SiO2 alpha?

0 投票
0 回答
39 浏览

python - 如何解决这部分程序中的这个关键错误

我的这部分代码有问题,它返回给材料的扩散分析师

关键错误说明了这一点

它是如何解决的? 它会返回程序吗?

0 投票
1 回答
48 浏览

python - ipython no error, jupyter has error ModuleNotFoundError: No module named 'ruamel'

I am running a Python package called pymatgen in Jupyter. Jupyter and pymatgen are installed in a conda environment. I have manually installed ruamel using conda's python3, but the same error occurs. The strange thing is that the same code (in this case just a library load statement) gives no errors when run with ipython. Both Jupyter and ipython are running from the miniconda installation (I check with the command which). I noticed some postings on the web stating that ruamel has problems with conda due to the remapping of a "." to an underscore character, but none of the proposed solutions helped the above problem. I also don't understand why ipython is fine and Jupyter fails. Any suggestions?

0 投票
0 回答
8 浏览

python-3.x - Pymatgen 的开发者安装

我想为 pymatgen 包做出贡献。我按照此处提供的说明进行操作: https ://pymatgen.org/installation.html#step-2-install-pymatgen-in-developmental-mode

一切都很顺利。如果我在克隆存储库的目录中打开一个交互式 python3 shell,我可以例如运行

并且没有投诉。我想首先运行一些保存在./pymatgen/core/tests/. 但是,如果我运行例如

我收到以下 ImportError:

为了运行这些测试,我需要做什么?