简体   繁体   中英

Anaconda-Error: cannot import name Transformer from pyproj

I try to install Transformer from pyproj and get the message "cannot import name". I installed pyproy using Anaconda Navigator. There it tells me I have version 1.9.6. (newest update). I found a thread about same issue but it didn't help me ( cannot import name Transformer from pyproj ). I checked pyproj-Documentation and installed via terminal conda install -c conda-forge proj-datumgrid-europe proj-datumgrid-north-america proj-datumgrid-oceania proj-datumgrid-world .

Not sure if that's the right thing to do. I'm a noob.-. help is appreciated.

ImportError                               Traceback (most recent call last)
/var/folders/jy/1f2tlvb965g30zhw9q3cvdw07r5rb_/T/ipykernel_49825/1776791710.py in <module>
      4 from shapely.geometry import Point, LineString
      5 import pyproj as pi
----> 6 from pyproj import Transformer

ImportError: cannot import name 'Transformer' from 'pyproj' (/Users/vob/opt/anaconda3/envs/geopandas/lib/python3.8/site-packages/pyproj/__init__.py)

 

The latest version of pyproj is 3.3 at the moment. To update, recommend looking at pyproj installation instructions: https://pyproj4.github.io/pyproj/stable/installation.html

Here is a snippet:

conda config --prepend channels conda-forge
conda config --set channel_priority strict
conda create -n pyproj_env pyproj
conda activate pyproj_env

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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