-
Notifications
You must be signed in to change notification settings - Fork 21
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
ModuleNotFoundError: No module named 'exceptions' #247
Comments
i have the same problem, i installed the python-docx but still have this error |
Having a similar issue but with a different module:
|
maybe rewrite the code or change python version to 2.x.
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2022年4月22日(星期五) 凌晨0:55
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [strands-project/strands_qsr_lib] ModuleNotFoundError: No module named 'exceptions' (Issue #247)
Having a similar issue but with a different module:
$ ./mwe.py rcc8 Traceback (most recent call last): File "/home/user/strands_qsr_lib/qsr_lib/scripts/./mwe.py", line 4, in <module> from qsrlib.qsrlib import QSRlib, QSRlib_Request_Message File "/home/user/strands_qsr_lib/qsr_lib/src/qsrlib/qsrlib.py", line 8, in <module> from qsrlib_qsrs import * File "/home/user/strands_qsr_lib/qsr_lib/src/qsrlib_qsrs/__init__.py", line 1, in <module> from qsr_rcc2 import QSR_RCC2 ModuleNotFoundError: No module named 'qsr_rcc2'
PYTHONPATH is correctly set. Any suggestion?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I'm currently running on Python 3.9.12 and faced the same issues mentioned above. I am by no means a Python expert but with a few minor modifications I managed to make the MWE working. Here are the steps I made:
Then the MWE can be executed successfully: ./mwe.py rcc8
['argd', 'argprobd', 'cardir', 'mos', 'mwe', 'qtcbcs', 'qtcbs', 'qtccs', 'ra', 'rcc2', 'rcc3', 'rcc4', 'rcc5', 'rcc8', 'tpcc']
rcc8 request was made at 2022-04-24 10:46:43.359738 and received at 2022-04-24 10:46:43.359747 and finished at 2022-04-24 10:46:43.359998
---
Response is:
0.0: o1,o2:{'rcc8': 'po'}; o1,o3:{'rcc8': 'po'}; o2,o1:{'rcc8': 'po'}; o2,o3:{'rcc8': 'po'}; o3,o1:{'rcc8': 'po'}; o3,o2:{'rcc8': 'po'};
1.0: o1,o2:{'rcc8': 'po'}; o1,o3:{'rcc8': 'po'}; o2,o1:{'rcc8': 'po'}; o2,o3:{'rcc8': 'po'}; o3,o1:{'rcc8': 'po'}; o3,o2:{'rcc8': 'po'};
2.0: o1,o2:{'rcc8': 'po'}; o1,o3:{'rcc8': 'po'}; o2,o1:{'rcc8': 'po'}; o2,o3:{'rcc8': 'po'}; o3,o1:{'rcc8': 'po'}; o3,o2:{'rcc8': 'po'}; Of course this rather is a "hacky" solution and for other calculi maybe additional fixes are necessary. The problem most likely stems from migrating from Python 2 to Python 3. Maybe the code just works fine with Python 2 but I can't confirm that since I've no ancient Python version installed :^) |
Thank you, i am already did this either. lol
…------------------ 原始邮件 ------------------
发件人: "Thomas ***@***.***>;
发送时间: 2022年4月24日(星期天) 下午5:09
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [strands-project/strands_qsr_lib] ModuleNotFoundError: No module named 'exceptions' (Issue #247)
I'm currently running on Python 3.9.12 and faced the same issues mentioned above.
I am by no means a Python expert but with a few minor modifications I managed to make the MWE working. Here are the steps I made:
In qsrlib_qsrs/__init__.py change the module import to relative paths:
(e.g., change from qsr_rcc2 import QSR_RCC2 to from .qsr_rcc2 import QSR_RCC2)
For the ModuleNotFoundError: No module named 'exceptions' error in qsrlib_qsrs/qsr_qtc_simplified_abstractclass.py simply remove the from exceptions import Exception, AttributeError import since it is not necessary in Python 3
In the same file (see above) replace every xrange() call with range()
In qsrlib_qsrs/qsr_arg_prob_relations_distance.py again change the module import to relative path:
from .qsr_arg_relations_distance import QSR_Arg_Relations_Distance
It seems that for the function _return_bounding_boxes_2d() in qsrlib_qsrs/qsr_monadic_abstractclass.py the return value which is a tuple must be explicitly made a tuple by just surrounding the return value:
raise (data1.return_bounding_box_2d(), data2.return_bounding_box_2d())
Lastly, to fix the error TypeError: 'dict_keys' object is not subscriptable which originates from make_world_qsr_trace() in qsrlib_qsrs/qsr_dyadic_abstractclass.py apply the following fix:
qsrs_for = self._process_qsrs_for(list(world_state.objects.keys()), req_params["dynamic_args"])
Then the MWE can be executed successfully:
./mwe.py rcc8 ['argd', 'argprobd', 'cardir', 'mos', 'mwe', 'qtcbcs', 'qtcbs', 'qtccs', 'ra', 'rcc2', 'rcc3', 'rcc4', 'rcc5', 'rcc8', 'tpcc'] rcc8 request was made at 2022-04-24 10:46:43.359738 and received at 2022-04-24 10:46:43.359747 and finished at 2022-04-24 10:46:43.359998 --- Response is: 0.0: o1,o2:{'rcc8': 'po'}; o1,o3:{'rcc8': 'po'}; o2,o1:{'rcc8': 'po'}; o2,o3:{'rcc8': 'po'}; o3,o1:{'rcc8': 'po'}; o3,o2:{'rcc8': 'po'}; 1.0: o1,o2:{'rcc8': 'po'}; o1,o3:{'rcc8': 'po'}; o2,o1:{'rcc8': 'po'}; o2,o3:{'rcc8': 'po'}; o3,o1:{'rcc8': 'po'}; o3,o2:{'rcc8': 'po'}; 2.0: o1,o2:{'rcc8': 'po'}; o1,o3:{'rcc8': 'po'}; o2,o1:{'rcc8': 'po'}; o2,o3:{'rcc8': 'po'}; o3,o1:{'rcc8': 'po'}; o3,o2:{'rcc8': 'po'};
Of course this rather is a "hacky" solution and for other calculi maybe additional fixes are necessary. The problem most likely stems from migrating from Python 2 to Python 3. Maybe the code just works fine with Python 2 but I can't confirm that since I've no ancient Python version installed :^)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I download the code on my computer with python3.10.x.
After following the installation, there shows an error.
I checked the file and the installation, it has't notes what the exceptions are.
And StackOverflow found no answer :)
How could i fix this problem?
The text was updated successfully, but these errors were encountered: