代码之家  ›  专栏  ›  技术社区  ›  four-eyes

PyProj的新Conda安装:PyProj无法设置数据库路径_pyproj_global_context_initialize()

  •  0
  • four-eyes  · 技术社区  · 3 年前

    我想使用 PyProj .我遵循 installation instructions given in the documentation

    conda config --prepend channels conda-forge
    conda config --set channel_priority strict
    conda install pyproj
    

    当我跑步时

    from pyproj import CRS
    

    我正在

    C: \用户…\Miniconda3\envs\geopandas\lib\site packages\pyproj_ 初始化

    -&燃气轮机;3.9.7 |由conda forge打包|(默认,2021 9月29日,19:15:42)[MSC v.1916 64位(AMD64)]

    0 回复  |  直到 3 年前
        1
  •  7
  •   four-eyes    3 年前

    快一点脏一点

    确保您处于您的环境中 conda activate YOUR_ENV

    conda remove --force pyproj
    

    这会将库从 conda environment .然后做一个

    pip install pyproj
    

    from pyproj import CRS .

    正确的方式

    https://pyproj4.github.io/pyproj/stable/gotchas.html#internal-proj-error-sqlite-error-on-select

    我是如何找到安装的路径的 proj ? 我查了这个文件 ...Miniconda3\envs\<ENV>\conda-meta\proj-<VERSION>-h1cfcee-<VERSION>.json \pkgs\\proj .找到后,我检查了 PROJ 已安装在此文件夹中 C:...\Miniconda3\pkgs\ 。有个文件夹名为 proj-<VERSION>-h1cfcee-<VERSION> 。确保文件夹名称与您找到的该文件链接的文件夹名称完全相同: 最后,我将环境变量设置为所需的版本 ...Miniconda3\pkgs\proj-<VERSION>-h1cfcee-<VERSION\Library\share\proj

    推荐文章