motion-planning / rrt-algorithms

n-dimensional RRT, RRT* (RRT-Star)
MIT License
600 stars 173 forks source link

Help with this errror #22

Closed michaelchi08 closed 5 years ago

michaelchi08 commented 5 years ago

michael@michael:~/dev/rrt-algorithms/examples/rrt$ python3 rrt_2d.py Traceback (most recent call last): File "rrt_2d.py", line 5, in from src.rrt.rrt import RRT ModuleNotFoundError: No module named 'src'

Hello, Can someone please help me with this error? i'm running this on ubuntu 18.04.

Thanks

SZanlongo commented 5 years ago

Which version of Python are you on?

It sounds like you might be on a version prior to 3.3. Each directory should have a file named __init__.py

For more information, try reading: Traps for the Unwary in Python’s Import System.

muety commented 5 years ago

I got the same problem. Using Python 3.6.8.

muety commented 5 years ago

Solved by doing export PYTHONPATH="$(pwd)" in project root.

kctoayo88 commented 4 years ago

@muety Hello, I met the same issue. Could you specify how did you solve this problem? I am using Ubuntu 16.04 and Anaconda with Python 3.7.7.

kctoayo88 commented 4 years ago

It is solved.

Add the following lines before the 'import'.

import sys
sys.path.append('./rrt_algorithms')

import numpy as np

from src.rrt.rrt_star import RRTStar
from src.search_space.search_space import SearchSpace
from src.utilities.plotting import Plot