in the testRunner file, I cannot import #RunWith(Cucumber.class) i have been watching many youtube videos everyone is saying sometimes we have to write down the import manually, even though I have written import manually which is import cucumber.api.junit.Cucumber; it is showing an error
Related
I am using Spyder as Editor/IDE.
I play with the options to include files/function/modules form other olders just to get a better understanding of how it works.
But Spyder rearranges my import statements in alphabetical order and thus breaks my functionality:
This is what I need:
import sys
sys.path.insert(1,'d:/pathtohelloworld/')
import helloworld
But when I do "Save File" in Spyder, it rearranges to
import helloworld
import sys
sys.path.insert(1,'d:/pathtohelloworld/')
and of course it will fail, since it cannot import "helloworld" before the path is defined via sys.path.insert.
This alphabetical order might be a good python style, but how can I fix this issue ?
I am trying to follow this tutorial on Google Cloud Platform,
https://github.com/GoogleCloudPlatform/ai-platform-samples/blob/master/notebooks/samples/tables/census_income_prediction/getting_started_notebook.ipynb, however, I am running into issues when I try to import the autoML module, specifically the below two lines
# AutoML library.
from google.cloud import automl_v1beta1 as automl
import google.cloud.automl_v1beta1.proto.data_types_pb2 as data_types
The first line works, but for the 2nd one, I get the error: ModuleNotFoundError: No module named 'google.cloud.automl_v1beta1.proto'. It seems for some reason there is no module called proto and I cannot figure out how to resolve this. There are a couple of posts regarding the issue of not being able to find module google.cloud. In my case I am able to import automl_v1beta1 from google.cloud but not proto.data_types_pb2 from google.cloud.automl_v1beta1
I think you can:
from google.cloud import automl_v1beta1 as automl
import google.cloud.automl_v1beta1.types as data_types
Or:
import google.cloud.automl_v1beta1 as automl
import google.cloud.automl_v1beta1.types as data_types
But (!) given the import errors, there may be other changes to the SDK in the code that follows.
Here's my directory structure:
app
-Folder1
-class-container.py
-queries.py
-script.py
-Folder2
-Folder3
-main.py
In my class-container file I import the SQL queries from queries.py with from Folder1.queries import sql_queries
When I import and use the class in main.py everything runs smoothly. But when I do the same from script.py I get a ModuleNotFoundError... no module named Folder1. I've tried relative imports and changing it to from queries import sql_queries but every time I change it, it breaks one or the other. Any insight would be valuable. Thanks!
When I organise my imports in Eclipse using Shift+Ctrl+O I get a strange order that's different to my colleagues.
For some reason, I get this order:
import java.util.concurrent.atomic.AtomicBoolean;
import start.mycompany.MyStartClass;
import com.mycompany.MyClass;
while my colleagues get:
import java.util.concurrent.atomic.AtomicBoolean;
import com.mycompany.MyClass;
import start.mycompany.MyStartClass;
All of us have the same settings in Preferences->Java->Code Style->Organize Imports which is java, javax, org, com.
I am on Linux and they are on Windows - we're all using Eclipse Luna at the moment.
When i write import such as import android.content.Intent; every time it is deleted automaticly. At the below of the ide unused import statement is existing. I have searched but solutions didn't work for me. How can i fix it ?