dezhin / osmread

Simple library for reading OpenStreetMap XML and PBF data files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while trying to install osmread

debjitbhowmick opened this issue · comments

Hi. I am trying to install osmread using pip install osmread in Anaconda prompt. However, it throws up the following error message. Can someone help?

Collecting osmread
  Using cached osmread-0.2.tar.gz (12 kB)
  Preparing metadata (setup.py) ... done
Collecting argparse
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting lxml
  Downloading lxml-4.9.0-cp310-cp310-win_amd64.whl (3.6 MB)
     ---------------------------------------- 3.6/3.6 MB 8.8 MB/s eta 0:00:00
Collecting protobuf==3.0.0b3
  Using cached protobuf-3.0.0b3.tar.gz (117 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\dbho0002\AppData\Local\Temp\pip-install-b57sx51_\protobuf_03c2a19988264f278eb8d36346edba7a\setup.py", line 17, in <module>
          from distutils.command.build_py import build_py_2to3 as _build_py
      ImportError: cannot import name 'build_py_2to3' from 'distutils.command.build_py' (C:\Users\dbho0002\Anaconda3\envs\lmm\lib\site-packages\setuptools\_distutils\command\build_py.py)
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I tried installing it by downloading the setup.py file using python setup.py install. Using conda list, I can see that osmread v 0.2 is installed. However, when I try to import osmread in Spyder, it throws up the following error:

Traceback (most recent call last):

  File "C:\Users\dbho0002\Anaconda3\envs\lmm\lib\site-packages\spyder_kernels\py3compat.py", line 356, in compat_exec
    exec(code, globals, locals)

  File "c:\users\dbho0002\downloads\st-matching-master\try2.py", line 10, in <module>
    import osmread

ModuleNotFoundError: No module named 'osmread'

Now when I search for osmread in conda using conda search osmread, it shows:

Loading channels: done
No match found for: osmread. Search: osmread

PackagesNotFoundError: The following packages are not available from current channels:

  - osmread

Current channels:

  - https://conda.anaconda.org/conda-forge/win-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Then I tried, pip install osmread but it shows:

Requirement already satisfied: osmread in c:\users\dbho0002\anaconda3\envs\lmm\lib\site-packages\osmread-0.2-py3.9.egg (0.2)
Collecting argparse
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Requirement already satisfied: lxml in c:\users\dbho0002\anaconda3\envs\lmm\lib\site-packages\lxml-4.9.0-py3.9-win-amd64.egg (from osmread) (4.9.0)
Requirement already satisfied: protobuf in c:\users\dbho0002\anaconda3\envs\lmm\lib\site-packages\protobuf-4.21.1-py3.9-win-amd64.egg (from osmread) (4.21.1)
Installing collected packages: argparse
Successfully installed argparse-1.4.0

You can download the source code, then use the command.

python setup.py install