Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to import geoutils after installing via pip #416

Closed
adamviola opened this issue Dec 11, 2023 · 2 comments · Fixed by #419 or #420
Closed

Fail to import geoutils after installing via pip #416

adamviola opened this issue Dec 11, 2023 · 2 comments · Fixed by #419 or #420
Labels
bug Something isn't working

Comments

@adamviola
Copy link

adamviola commented Dec 11, 2023

Describe the bug
I get a "geoutils is not properly installed" error when importing geoutils after installing via pip.

Traceback (most recent call last):
  File "/home/aviola/venvs/test_venv/lib/python3.10/site-packages/geoutils/__init__.py", line 10, in <module>
    from geoutils._version import __version__ as __version__  # noqa
ModuleNotFoundError: No module named 'geoutils._version'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/aviola/venvs/test_venv/lib/python3.10/site-packages/geoutils/__init__.py", line 12, in <module>
    raise ImportError(
ImportError: geoutils is not properly installed. If you are running from the source directory, please instead create a new virtual environment (using conda or virtualenv) and then install it in-place by running: pip install -e .

To Reproduce
Steps to reproduce the behavior:

  1. Create new Python venv: python -m venv test_venv
  2. Activate new venv
  3. pip install geoutils
  4. import geoutils

Fails on all Python versions I tried: Python 3.8, 3.10 and 3.11

Expected behavior
I expected to be able to import geoutils without having to use conda or mamba.

System (please complete the following information):

  • OS: Ubuntu 22.04
  • Environment:
    Just a clean venv + geoutils
affine==2.4.0
attrs==23.1.0
certifi==2023.11.17
click==8.1.7
click-plugins==1.1.1
cligj==0.7.2
contourpy==1.2.0
cycler==0.12.1
fiona==1.9.5
fonttools==4.46.0
geopandas==0.14.1
geoutils==0.0.16
kiwisolver==1.4.5
matplotlib==3.8.2
numpy==1.26.2
packaging==23.2
pandas==2.1.4
Pillow==10.1.0
pip==22.0.2
pyparsing==3.1.1
pyproj==3.6.1
python-dateutil==2.8.2
pytz==2023.3.post1
rasterio==1.3.9
rioxarray==0.15.0
scipy==1.11.4
setuptools==69.0.2
setuptools-scm==8.0.4
shapely==2.0.2
six==1.16.0
snuggs==1.4.7
tomli==2.0.1
tqdm==4.66.1
typing_extensions==4.9.0
tzdata==2023.3
xarray==2023.12.0

Additional context

Maybe something's up with the writing of _version?

https://github.com/GlacioHack/geoutils/blob/main/pyproject.toml#L12

My install doesn't have that file:
image

Edit: I have no issues importing geoutils==0.0.8. Using the older version as my work-around for now

@adamviola adamviola added the bug Something isn't working label Dec 11, 2023
@rhugonnet
Copy link
Member

Thanks for the detailed issue @adamviola! Probably triggered by #398, I'll look at this early next week.

A good occasion to add a CI test that checks the pip install by itself (right now our CI only checks the pip install after installing a base conda environment).

@rhugonnet
Copy link
Member

Fixed in #419 and #420 and added a test in #421 to ensure this won't happen again! (PRs split into pieces as changes had to be merged to main to test-run the PyPI publish action in CI)
I'll release a 0.0.17 that can be pip install 😄
Thanks again @adamviola!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants