Git Product home page Git Product logo

Comments (6)

anitagraser avatar anitagraser commented on May 30, 2024

There is no packaged release of MovingPandas yet, so it cannot be installed in the same sense as a proper Python page.

trajectory.py does not contain import movingpandas as mp. Do you mean one of the ipynb notebooks? (They do contain this line.)

The easiest way to use MovingPandas right now is through the MyBinder notebook at: https://mybinder.org/v2/gh/anitagraser/movingpandas/master

Alternatively, I recommend installing Anaconda. Then you can use the environment.yml config file to tell conda how to configure a Python environment that is compatible with MovingPandas. This way you can run the included ipynb notebooks locally on your machine or start using MovingPandas in your own projects.

from movingpandas.

jakeeegarcia-alb avatar jakeeegarcia-alb commented on May 30, 2024

Hi! Thanks for the reply. If i opt to go with the creation of an environment through anaconda, what exactly do I need to do?

I have the following steps in mind:

1.) Install anaconda,
2.) copy the environments.yml file to the env directory of conda
3.) Then execute the following code in my terminal
conda env create -f environment.yml

But, do I still need to add anything to the environment.yml file downloaded from github? What other steps am I missing?

I want to create a similar plot you have in the mybinder notebook at Out[21] but with my own point data.

from movingpandas.

anitagraser avatar anitagraser commented on May 30, 2024

The following steps should do it:

  1. Install Anaconda
  2. Clone the movingpandas repository
  3. In Anaconda Navigator | Environments | Import select the movingpandas environment.yml from the cloned directory:

image

  1. Wait until the environment is ready, then change to the Home tab and install Jupyter notebooks into the movingpandas environment
  2. Launch Jupyter notebooks and navigate to the cloned directory to execute them
  3. Now you can adjust the code to use your own data

from movingpandas.

jakeeegarcia-alb avatar jakeeegarcia-alb commented on May 30, 2024

Hi,

Thanks for the tips.

I did everything from 1 to 6, but whenever I try to execute the import statements in the notebook, I get this error. I tried reading it but cannot seem to understand why it occurs

I ran these codes first in the notebook:

import urllib import os import pandas as pd import movingpandas as mp import contextily as ctx from geopandas import GeoDataFrame, read_file from shapely.geometry import Point, LineString, Polygon from datetime import datetime, timedelta

Then this is the error message:

`---------------------------------------------------------------------------
OSError Traceback (most recent call last)
in
2 import os
3 import pandas as pd
----> 4 import movingpandas as mp
5 import contextily as ctx
6 from geopandas import GeoDataFrame, read_file

~/Downloads/movingpandas-master/movingpandas/init.py in
3 """
4
----> 5 from .trajectory import *
6
7 version = '0.99.0.dev'

~/Downloads/movingpandas-master/movingpandas/trajectory.py in
4 import sys
5
----> 6 import contextily as ctx
7
8 from shapely.affinity import translate

~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/contextily/init.py in
4
5 from . import tile_providers as sources
----> 6 from .place import Place, plot_map
7 from .tile import *
8 from .plotting import add_basemap, add_attribution

~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/contextily/place.py in
4 import matplotlib.pyplot as plt
5 from warnings import warn
----> 6 from .tile import howmany, bounds2raster, bounds2img, _sm2ll, _calculate_zoom
7 from .plotting import ATTRIBUTION, INTERPOLATION, ZOOM, add_attribution
8

~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/contextily/tile.py in
10 import rasterio as rio
11 from PIL import Image
---> 12 from cartopy.io.img_tiles import _merge_tiles as merge_tiles
13 from rasterio.transform import from_origin
14 from . import tile_providers as sources

~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/cartopy/init.py in
105 # Commonly used sub-modules. Imported here to provide end-user
106 # convenience.
--> 107 import cartopy.crs
108 import cartopy.feature # noqa: F401 (flake8 = unused import)

~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/cartopy/crs.py in
30
31 import numpy as np
---> 32 import shapely.geometry as sgeom
33 from shapely.prepared import prep
34 import six

~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/shapely/geometry/init.py in
2 """
3
----> 4 from .base import CAP_STYLE, JOIN_STYLE
5 from .geo import box, shape, asShape, mapping
6 from .point import Point, asPoint

~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/shapely/geometry/base.py in
15
16 from shapely.affinity import affine_transform
---> 17 from shapely.coords import CoordinateSequence
18 from shapely.errors import WKBReadingError, WKTReadingError
19 from shapely.ftools import wraps

~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/shapely/coords.py in
6 from ctypes import byref, c_double, c_uint
7
----> 8 from shapely.geos import lgeos
9 from shapely.topology import Validating
10

~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/shapely/geos.py in
111 _lgeos = load_dll('geos_c', fallbacks=alt_paths)
112
--> 113 free = load_dll('c').free
114 free.argtypes = [c_void_p]
115 free.restype = None

~/anaconda3/envs/movingpandas_/lib/python3.7/site-packages/shapely/geos.py in load_dll(libname, fallbacks, mode)
54 raise OSError(
55 "Could not find lib {0} or load any of its variants {1}.".format(
---> 56 libname, fallbacks or []))
57
58 _lgeos = None

OSError: Could not find lib c or load any of its variants [].`

I am not sure what is happening. I have done all the steps including the install Jupyter from the Home tab to my movingpandas environment. Any ideas on what could be happening?

from movingpandas.

anitagraser avatar anitagraser commented on May 30, 2024

from movingpandas.

jakeeegarcia-alb avatar jakeeegarcia-alb commented on May 30, 2024

Hi. Im using a OSX

It seems that it's a problem I also have with shapely. I've been trying to fix it but cannot seem to find a solution.

This is the link of what I experience with shapely also. I have installed all depndencies from conda-forge as to not have it mixing up with defaults. But it still has problems with regard to geos and its libs as seen here

https://stackoverflow.com/questions/57443539/oserror-could-not-find-lib-c-or-load-any-of-its-variants

from movingpandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.