我正在尝试安装 pyproj ,但出现 Proj executable not found. Please set PROJ_DIR variable 错误。

命令
$ pipenv install pyproj
我也尝试过 pipenv git+https://github.com/jswhit/pyproj.git#egg=pyproj 以获得相同的结果。

输出
$ pipenv install pyprojInstallation SucceededLocking [dev-packages] dependenciesLocking ['packages] dependanciesSuccess!Installing dependencies from Pipfile.lock
错误
[pipenv.exceptions.InstallError]: ['Collecting pyproj==2.0.0 (from -r /var/folders/g3/912vtylj2hb71xf_d_8sxz480000gn/T/pipenv-qeun2uwi-requirements/pipenv-behbdii2-requirement.txt (line 1))', ' Using cached https://files.pythonhosted.org/packages/53/4b/21643a93e7d33941498087290636e34c6d534aa8baa1ada54cf0d096ffaa/pyproj-2.0.0.tar.gz', ' Installing build dependencies: started', " Installing build dependencies: finished with status 'done'",' Getting requirements to build wheel: started', " Getting requirements to build wheel: finished with status 'error'", ' Complete output from command /Users/darcyprice/.local/share/virtualenvs/pure-dawn-52933-x98m1awW/bin/python3 /Users/darcyprice/.local/share/virtualenvs/pure-dawn-52933-x98m1awW/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/g3/912vtylj2hb71xf_d_8sxz480000gn/T/tmpwq5vvpkd:', ' Proj executable not found. Please set PROJ_DIR variable.', ' ', ' ----------------------------------------'][pipenv.exceptions.InstallError]: ['Command "/Users/darcyprice/.local/share/virtualenvs/pure-dawn-52933-x98m1awW/bin/python3 /Users/darcyprice/.local/share/virtualenvs/pure-dawn-52933-x98m1awW/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/g3/912vtylj2hb71xf_d_8sxz480000gn/T/tmpwq5vvpkd" failed with error code 1 in /private/var/folders/g3/912vtylj2hb71xf_d_8sxz480000gn/T/pip-install-t_ap8o3w/pyproj']

最佳答案

Installation instructions 建议安装预编译轮子或使用 conda 包管理器。

如果您仍然想从源代码编译 PyProj,则需要 setup PROJ.4(请理解 PyProj 是 Proj 的 Python 包装器)。

关于python - PyProj 包安装 PROJ_DIR 变量,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55084003/

10-13 08:52