2

I am trying to use Transformer from pyproj using the code below. I, however, get an error attached. What could be the issue?


ImportError                               Traceback (most recent call last)
<ipython-input-1-11c55c4b670c> in <module>
----> 1 from noiseplanet.matcher import matching
      2 import geopandas
      3 import pandas
      4 import osmnx

~\Anaconda3\lib\site-packages\noiseplanet\matcher\__init__.py in <module>
      6 """
      7 
----> 8 from noiseplanet.matcher.model.route import graph_from_track, route_from_track
      9 from noiseplanet.matcher.matching import *
     10 from noiseplanet.matcher.datacleaner import clean_data

~\Anaconda3\lib\site-packages\noiseplanet\matcher\model\__init__.py in <module>
      7 
      8 from noiseplanet.matcher.model.leuven import match_leuven
----> 9 from noiseplanet.matcher.model.nearest import match_nearest_edge
     10 from noiseplanet.matcher.model.route import graph_from_track, route_from_track

~\Anaconda3\lib\site-packages\noiseplanet\matcher\model\nearest.py in <module>
     14 import osmnx as ox
     15 import numpy as np
---> 16 from pyproj import Proj, Geod, Transformer
     17 
     18 # Useful script

ImportError: cannot import name 'Transformer' from 'pyproj' (C:\Users\nzhuw\Anaconda3\lib\site-packages\pyproj\__init__.py)

Zhuwaki
  • 21
  • 4
  • 1
    aalways put full error message(startingat word "Traceback") in question (not comment) as text (not screenshot). There are other useful information. – furas Dec 30 '20 at 08:13
  • 1
    error shows problem in module `noisedplanet` - maybe it expects some older version of `pyproj` and it tries to import `Transformer` but in `pyproj` I can see only [transformer.Transformer](https://github.com/pyproj4/pyproj/blob/master/pyproj/__init__.py#L65) – furas Dec 30 '20 at 08:16
  • I see you already send [issues](https://github.com/arthurdjn/noiseplanet/issues/1) on noiseplanet :) At this moment you may only try to change `from pyproj import Transformer` into `from pyproj.transformer import Transformer` - but maybe code will need much more changes in imports – furas Dec 30 '20 at 08:20
  • @furas Thank you, I have amended the question. Hope that's better. I have attempted to use ```from pyproj.transformer import Transformer``` it then throws off another ImportError ```cannot import name 'CRS' from pyproj ```. So I suppose this would require much more changes. Trying to roll back to a previous version of pyproj, though I cant seem to find the documentation fro previous versions. Thanks again ! – Zhuwaki Dec 30 '20 at 08:48
  • What version of pyproj do you have installed? – snowman2 Dec 30 '20 at 23:44
  • @snowman2 I have pyproj version 3.0.0 – Zhuwaki Dec 31 '20 at 19:54
  • @Zhuwaki, can you please close your issue if the answer below solved your issue ? Thanks. – jegertor Jan 08 '21 at 13:41

0 Answers0