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

python client.py 的相对导入问题 #9

Open
xiaoToby opened this issue Dec 25, 2023 · 4 comments
Open

python client.py 的相对导入问题 #9

xiaoToby opened this issue Dec 25, 2023 · 4 comments

Comments

@xiaoToby
Copy link

(ad_py37) D:\UAV-auto-navigation-and-object-tracking-based-on-RL-main>D:/anaconda/envs/ad_py37/python.exe d:/UAV-auto-navigation-and-object-tracking-based-on-RL-main/airsim_rl/misc/move_to_airsim/client.py
Traceback (most recent call last):
File "d:/UAV-auto-navigation-and-object-tracking-based-on-RL-main/airsim_rl/misc/move_to_airsim/client.py", line 9, in
from .utils import *
ImportError: attempted relative import with no known parent package

(ad_py37) D:\UAV-auto-navigation-and-object-tracking-based-on-RL-main>D:/anaconda/envs/ad_py37/python.exe d:/UAV-auto-navigation-and-object-tracking-based-on-RL-main/airsim_rl/misc/move_to_airsim/client.py
Traceback (most recent call last):
File "d:/UAV-auto-navigation-and-object-tracking-based-on-RL-main/airsim_rl/misc/move_to_airsim/client.py", line 11, in
from .types import *
ImportError: attempted relative import with no known parent package

@super-NOV-a
Copy link

sys.path.append("E:\UAV-auto-navigation-and-object-tracking-based-on-RL\airsim_rl\")
from utils import *
from misc.move_to_airsim.types import *

I tried the code above, and it worked, hope it can help.

@jzstudent
Copy link
Owner

检查下move_to_airsim 文件哈

@majingchunn
Copy link

sys.path.append(“E:\UAV-auto-navigation-and-object-tracking-based-on-RL\airsim_rl\”) from utils import * from misc.move_to_airsim.types import *

我尝试了上面的代码,它起作用了,希望它能有所帮助。

Could you please tell me exactly where this code is added to run?

@majingchunn
Copy link

Uploading 1.png…

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

4 participants