Django Import Error: I can't start my Django app - importerror

I think I did something wrong that's why my Django project is not running. My runserver and makemigrations commands are not working.
I don't know in which file I am getting error. I have 3 file with the name of int.py. Two file in my app folder and one in the project folder but they are totally blank
I didn't get any error like this before, I run 10 to 15 projects but now all my projects are not running.
Error I am getting:
ImportError: cannot import name 'View' from 'django.views' (C:\Users\Haseeb-Predator\AppData\Local\Programs\Python\Python310\lib\site-packages\django\views_init_.py)

Related

trying to connect postgresql to go but I'm getting an error

I've imported a module called "github.com/lib/pq". before I ran my code, I inserted this in the terminal % go get github.com/lib/pq. Then when i tried to run my code, I'm getting an error message in the terminal
'no required module provides package github.com/lib/pq: go.mod file not found in current directory or any parent directory; see 'go help modules'
Running go mod tidy will sync your go.mod and go.sum file with the imports in your code, this will add missing dependencies and remove unnecessary ones. Should solve your issue.

How can we run Robot Framework files and Test cases using command line?

Please can anyone suggest and help how can we execute the Robot Framework Test Cases and Files via command line ?
My Robot Framework Directory Location is as follows :
/Users/tanyagrover/Desktop/Robot Files/Charcoal PreProd
I've tried :
robot -L debug Charcoal preprod.robot
and got error as :
File "/usr/local/bin/robot", line 6, in <module>
from robot.run import run_cli
ModuleNotFoundError: No module named 'robot'
I'am using ride.py to create my test cases and the test cases are running fine when i'm using RIDE UI. But I want to run my test cases using Robot CLI. Whenever I'am executing my .robot file using robot command I'am getting following error
robot Login.robot
Traceback (most recent call last):
File "/usr/local/bin/robot", line 6, in
from robot.run import run_cli
ModuleNotFoundError: No module named 'robot'
Thank You
The reason you are getting the below error is , you need to go to the same virtualenv/interpreter where you have installed robotframework,as you have configured your eclipse to run on. Otherwise, you will get the below error.
File "/usr/local/bin/robot", line 6, in <module>
from robot.run import run_cli
ModuleNotFoundError: No module named 'robot'
Steps to remedy
You need to use the same virtualenv/interpreter and
then make sure you have robotframework installed and
then you need to invoke robot, only then it is going to work.
APPROACH#0
Assuming that you have created a virtualenv/interpreter with robotframework installed successfully, then you need to just
cd to that specific directory and
then execute robot as mentioned below.
If you want to run all the testcases from all the files and folders under Prepod
cd /Users/tanyagrover/Desktop/Robot\ Files/Charcoal\ PreProd
robot *.robot
NOTE: few users are confused regarding "cd" when dir name contains
space i have created a simple folder name "sample sd"(there is a space
in the folder name)
On mac this works,
cd sample\ sd/
06:30 PM##~/sample sd::>
First, make sure you have robot framework installed and it is found in PYTHONPATH environment variable.
For executing the tests, there are many ways to do this.
Option #1:
Go to Charcoal PreProd folder and just robot Suites
Option #2:
Go to Suites folder and just robot .
Option #3:
If you wanna run only Login test suite, in Charcoal PreProd folder: robot Login.robot (assuming the file extension for Login file is robot).
Also note that the last argument cannot have spaces as you have in Charcoal preprod.robot. In this case, you should use quotes: 'Charcoal preprod.robot'.
Setting default python version to 3.6 worked for me

PySpark on Linux with pycharm - first exception error

I am trying to run my first PySpark script on a Linux VM I configured. The error message I have is KeyError: SPARK_HOME when I run the following:
from os import environ
from pyspark import SparkContext
I momentarily made this error go away by running export SPARK_HOME=~/spark-2.4.3-bin-hadoop2.7. I then ran into a new error error=2, No such file or directory. Searching took me to this page:https://community.cloudera.com/t5/Community-Articles/Tutorial-Install-Configure-iPython-and-create-run-PySpark/ta-p/246400. I then ran export PYSPARK_PYTHON=~/python3*. This brings me back to experiencing the KeyError: SPARK_HOME error.
Honestly, I'm stumbling through this, because it's my first time configuring Spark, and using PySpark. I still don't quite understand the ins-and-outs of pycharm, as well.
I expect to be able to run the following basic sample script on this page: https://medium.com/parrot-prediction/integrating-apache-spark-2-0-with-pycharm-ce-522a6784886f with no issues.
there is a package called findspark here
or you may use below code to set path if not found in environment
import os
if 'SPARK_HOME' not in os.environ:
os.environ['SPARK_HOME'] = 'full_path_to_spark_root'
[code continues]

Error: Cannot find module 'C:\project\node_modules\cucumber\bin\cucumber'

I am creating protractor cucumber project using TypeScript. While trying to run my cucumber test in protractor I am getting below error message. I have installed cucumber globally as well in the root of my project folder. Still getting same issue. :
Below is my bin folder structure. I do not see any 'cucumber' file or folder. However, I do see cucumber-js file. When I copy cucumber.js file from dist folder the error goes away. But that gives some other errors.
bin folder contents:
cucumber-js
run_slave
Because there are issues with cucumber v4.2.1 on windows 7 64bits.
For now please try the following:
Delete the existing cucumber folder from your "../project/node_modules"
Run "npm install cucumber#1.3.3." in "../project/node_modules"
Try executing your scripts now Check if the issue persists!

Error when running yeoman init

I'm getting the following error when I run `yeoman init angularĂ¹, although the angular part shouldn't matter, since I got the same error:
create test/lib/angular-mocks.js
<WARN> Unable to create directory "/Users/myuserfolder/test/lib" (Error code: ENOTDIR). Use --force to continue. </WARN>
it seems to be trying to create a file in my home folder, which is weird, becuse I cd'd into a folder designated for my project. What could be going on here?
That is a known bug caused by you having a Gruntfile in your home directory.