简体   繁体   English

从命令行安装 python package 时出错

[英]Error installing python package from command line

I'm trying to efficiently code quantum mechanical time-evolution which requires me to exponentiate Hamiltonian matrices that are very large but very sparse.我正在尝试有效地编码量子力学时间演化,这需要我对非常大但非常稀疏的哈密顿矩阵求幂。 To do this, I have been trying to install the expokit python wrapper ( https://github.com/weinbe58/expokitpy ) but am running into issues.为此,我一直在尝试安装 expokit python 包装器( https://github.com/weinbe58/expokitpy ),但遇到了问题。 I am on Mac and once I download the files and run python setup.py install the terminal runs through an installation process but then returns我在 Mac 上,一旦我下载文件并运行python setup.py install终端运行安装过程,然后返回

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing 
xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing 
xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: Command "/usr/local/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops -I/opt/anaconda3/lib/python3.7/site-packages/numpy/core/include -c -c ./expokit/lapack.f -o build/temp.macosx-10.9-x86_64-3.7/expokit/lapack.o" failed with exit status 

This is my first time installing a package not using pip install and I can't figure out what's going on here.这是我第一次安装 package 而不使用pip install ,我不知道这里发生了什么。 Any help is much appreciated!任何帮助深表感谢!

PS if anyone knows a better package that I should be using, please let me know too! PS如果有人知道我应该使用的更好的package,也请告诉我!

This is not a problem with python, your xcode not installed properly (or missing permissions or something).这不是 python 的问题,您的 xcode 安装不正确(或缺少权限等)。

xcode-select --install

Will probably fix it.可能会修复它。 For more info, look at this article有关更多信息,请查看这篇文章

Also, why not just use scipy?另外,为什么不直接使用 scipy? Scipy provides the same functionality, and will probably work better for you if you're already using numpy/scipy. Scipy 提供了相同的功能,如果您已经在使用 numpy/scipy 可能会更好。 See docs查看文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM