import

cannot import name 'ClassName' from 'PythonFile' using ROS Noetic

cannot import name 'ClassName' from 'PythonFile' using ROS Noetic Question: I’m using Python 3.8.10 and Ubuntu 20.04, I’m getting this Error: Traceback (most recent call last): File "/home/belal/git/decision_making_pacbot/devel/lib/ros_planning/ros_plan.py", line 15, in <module> exec(compile(fh.read(), python_script, ‘exec’), context) File "/home/belal/git/decision_making_pacbot/src/ros_planning/src/ros_planning/ros_plan.py", line 8, in <module> from problem_handler import ProblemHandler ImportError: cannot import name ‘ProblemHandler’ from ‘problem_handler’ (/home/belal/git/decision_making_pacbot/devel/.private/ros_planning/lib/ros_planning/problem_handler.py) My …

Total answers: 1

Split CSV file which contains multiple tables into different pandas dataFrames (Python)

Split CSV file which contains multiple tables into different pandas dataFrames (Python) Question: I have multiple CSV files which are formatted with multiple tables inside separated by line breaks. Example: Technology C_inv [MCHF/y] C_maint [MCHF/y] NUCLEAR 70.308020 33.374568 HYDRO_DAM_EXISTING 0.000000 195.051200 HYDRO_DAM 67.717942 1.271600 HYDRO_RIVER_EXISTING 0.000000 204.820000 IND_BOILER_OIL 2.053610 0.532362 IND_BOILER_COAL 4.179935 1.081855 IND_BOILER_WASTE 11.010126 …

Total answers: 1

how to write output of one module in another module as csv file

how to write output of one module in another module as csv file Question: I am trying to write output of one module in a output file of another module. For example, first module : def sentence_token(): # some code sentences = sentence_tokenizer(tokens) count_sentence = f"total count of sentence is {len(sentences)}" second module : def …

Total answers: 1

How to properly import modules in a Pycharm project?

How to properly import modules in a Pycharm project? Question: I have some issues importing some modules in my latest project. I’m really new to Pycharm and Python and I could really use the help/insight. The problem is I have a folder of utils i wanna use but I cant seem to import modules correctly. …

Total answers: 1

I don't think it's getting all the info from other files

I don't think it's getting all the info from other files Question: I’m working on a pygame project but when I run it, it’s not working. There are a lot of messages in my code saying the files imported may be "undefined or defined" which is confusing. I can’t tell if that’s the reason or …

Total answers: 1

Permission denied when calling SHAP

Permission denied when calling SHAP Question: I am using Jupyter Notebook and my OS is windows. I wanted to call shap library using the code !pip install shap but I got this error: ModuleNotFoundError: No module named ‘shap’ I have already installed shap in windows Command Prompt by pip install shap After that I tried …

Total answers: 1

Interaction between import, class and match…case in Python

Interaction between import, class and match…case in Python Question: I’m puzzled by how from … import …, class constructor and match…case in Python interact between each other. Given there are two modules, foo and bar. foo imports CONST from bar and tries to use it in Foo class __init__() within match…case construction. This gives UnboundLocalError. …

Total answers: 1

Import "lab_utils_uni could not be resolved

Import "lab_utils_uni could not be resolved Question: I need help with this Problem: Import "lab_utils_uni" could not be resolved. I installed numpy and matplotlib but lab_utils_uni didnt work. I am working with Visual Studio Code btw. import numpy as np import matplotlib.pyplot as plt from lab_utils_uni import plt_intuition, plt_stationary, plt_update_onclick, soup_bowl x_train = np.array([1.0, 2.0]) …

Total answers: 3

I cannot import from another file

I cannot import from another file Question: I am making a soccer game. I am new to Python. I am trying to make soccerplayers on a file, then import it to my main game. Here is soccerplayer.py class soccerp: def __init__(self,overall,name,speed,shoot,ballc,defence): self.overall = overall self.name = name self.speed = speed self.shoot = shoot self.ballc = …

Total answers: 2