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

pydist and windows support #1

Open
Neabfi opened this issue Jun 8, 2018 · 4 comments
Open

pydist and windows support #1

Neabfi opened this issue Jun 8, 2018 · 4 comments

Comments

@Neabfi
Copy link

Neabfi commented Jun 8, 2018

Hey, great job but is there a way to avoid this error on windows ?
Thanks !

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-12-3c704a212d75> in <module>()
----> 1 import traj_dist.distance as tdist

c:\users\<placeholder>\appdata\local\conda\conda\envs\playground\lib\site-packages\traj_dist\distance.py in <module>()
----> 1 from pydist.linecell import trajectory_set_grid
      2 
      3 from cydist.sspd import c_e_sspd, c_g_sspd
      4 from cydist.dtw import c_e_dtw, c_g_dtw
      5 from cydist.erp import c_e_erp, c_g_erp

ModuleNotFoundError: No module named 'pydist'
@bguillouet
Copy link
Owner

Hi Neafbi, and Thank you!.

I really have no experience in Windows, Hence I can't reproduce your error and i have no clue about how to solve it :(

@hippolyte-dubois
Copy link

I had the same issue building with Python3, make sure you're building with Python2.

@itamar-otonomo
Copy link

Hey Guys,
I figured out a way for making the code usable on python3.

Simple steps:

The old Geohash lib doesn't seem to work with python3 no more, I have replaced it with geohash2 and edited the code in the file traj_dist/pydist/linecell.py from:

import Geohash.geohash as geoh

to:

import geohash2 as geoh

Also, in setup.py I replaced the requirement to geohash2.

Use 2to3 script to get python3 ready code:

 2to3 --output-dir=traj-dist-py3 -W -n traj-dist

Copy the pyx files over from the original package in the cydist dir to the cydist dir under the new traj-dist-py3/traj_dist dir

From the traj-dist-py3 directory build the extensions and then a wheel file using:

python setup.py build_ext --inplace --force
python setup.py bdist_wheel

And finally install using pip and the newly created wheel file - looks like this:

pip install traj_dist/trajectory_distance-1.0-cp36-cp36m-macosx_10_9_x86_64.whl

@JvqingLiu
Copy link

JvqingLiu commented Mar 27, 2020

I also figured out a way to solve this problem, I uesd python 3.6.1 32bit. I checked “distance.py” when I met the error"No module named 'pydist'". Then I made the following changes :"
from pydist.linecell import trajectory_set_grid
from cydist.sspd import c_e_sspd, c_g_sspd
from cydist.dtw import c_e_dtw, c_g_dtw
from cydist.erp import c_e_erp, c_g_erp
from cydist.edr import c_e_edr, c_g_edr
from cydist.lcss import c_e_lcss, c_g_lcss
from cydist.hausdorff import c_e_hausdorff, c_g_hausdorff
from cydist.discret_frechet import c_discret_frechet
from cydist.frechet import c_frechet
from cydist.sowd import c_sowd_grid"
changed into
"
from traj_dist.pydist.linecell import trajectory_set_grid
from traj_dist.cydist.sspd import c_e_sspd, c_g_sspd
from traj_dist.cydist.dtw import c_e_dtw, c_g_dtw
from traj_dist.cydist.erp import c_e_erp, c_g_erp
from traj_dist.cydist.edr import c_e_edr, c_g_edr
from traj_dist.cydist.lcss import c_e_lcss, c_g_lcss
from traj_dist.cydist.hausdorff import c_e_hausdorff, c_g_hausdorff
from traj_dist.cydist.discret_frechet import c_discret_frechet
from traj_dist.cydist.frechet import c_frechet
from traj_dist.cydist.sowd import c_sowd_grid
"
add the modle name"traj_dist"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants