我是Python新手。已安装 python 版本 3.7.3、Visual Studio 和构建工具。在安装 ephem 之前已执行命令“python -m pip install -U pip setuptools”。显示以下消息并且 ephem 安装失败:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
Command "c:\users\aomine\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Aomine\AppData\Local\Temp\pip-install-eouyp2bg\ephem\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Aomine\AppData\Local\Temp\pip-record-_98cs8eb\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Aomine\AppData\Local\Temp\pip-install-eouyp2bg\ephem\
最佳答案
有预编译的二进制轮at PyPI (这是从 pip
下载软件包的地方)Python 2.7、3.3 和 3.4 如果你降级你的 Python,你可以安装其中一个而不需要编译。
如果你坚持使用Python 3.7,你必须install MS Visual C++ 14.0 。另请参阅https://wiki.python.org/moin/WindowsCompilers .
顺便说一句,你知道吗PyEphem is deprecated ?最后一次发布是在 2015 年。作者推荐了 2 个替代方案:https://rhodesmill.org/skyfield/和 http://www.astropy.org/ .
关于python 和 ehem 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55518711/