python安装第三方库streamtracer一直出错?已经安装好fortran编译器和C++组件?
我看你这个问题 git上有反馈
有人解决了你参考下
https://github.com/dstansby/streamtracer/issues/61
我顺带给你机翻出来
1 安装 Python、numpy
2 安装MinGW(对应python并将包含gfortran.exe的方向添加到系统路径)
3 下载streamtracer 执行命令:f2py -c Streamtracer.f90 -m streamtracer -lgomp --compiler=mingw32 --f90flags=”-fopenmp”
打开python,输入
import os
os.add_dll_directory(r”path_to_gfortran”)
import streamtracer
exit()
如果没有报错,说明安装成功。
编辑“xxxx\streamtracer\streamline.py”,在前面添加
"
import os
os.add_dll_directory(r”path_to_gfortran”)
"
path_to_gfortran替换为MinGw的系统路径
打开 python 并使用
import numpy
numpy.__file__获取其路径下
streamline.py文件复制到改路径
下“xxxx\streamtracer\test”
打开cmd用pip3安装pytset,比“python -m pytest test_streamline.py”
如果没有报错,安装是成功的。
emmmm 最后用mac环境下解决了