Tag Archives: error

R language – error analysis – error in Call.graphics (C_ palette2, .Call(C_ palette2, NULL)) : invalid graphics state

problem description: plot, the error 01

> ggplot(religions_long, 
+        aes(State, value, fill = variable)) +
+     geom_bar(stat = "identity") +
+     coord_flip()
> Error in .Call.graphics(C_palette2, .Call(C_palette2, NULL)) : 
  invalid graphics state

solution: maybe R can’t bear too much drawing, so empty all drawing will

error C2065: ‘cout’ : undeclared identifier

question:

online solution:
1. No

added

#include <iostream>
using namespace std;

or
2. The order of the included libraries needs to be adjusted

//These will not work.
#include <iostream>
using namespace std;
int main () {
    cout << "hey" << endl;
    return 0;
}
#include <iostream>
#include "stdafx.h"
using namespace std;
int main () {
    cout << "hey" << endl;
    return 0;
}
//This will do.

#include "stdafx.h"
#include <iostream>
using namespace std;
int main () {
    cout << "hey" << endl;
    return 0;
}

final solution: my own reasons… Orz)
open iostream file. I commented out part of the code for a project…
just uncomment it.

fail to start Unity Package Manager

fail to start Unity Package Manager,

my environment is Unity 2018.2.3f1 + Win10

solution:

1. Set the value of environment variable UNITY_NOPROXY to localhost,127.0.0.1

quickly set CMD command: setx UNITY_NOPROXY localhost,127.0.0.1

2, find C:\Windows\System32\drivers\etc\hosts file, remove the comment symbol before “127.0.0.1 localhost” and save.

3, close the system firewall, close the system firewall, close the system firewall…

4, close antivirus software, eliminate interference…

Server Tomcat v8.0 Server at localhost failed to start.

error message:
Server Tomcat v8.0 Server at localhost failed to start.

this situation appears, generally there are two situations.

The first type:
port is occupied or the service is forcibly closed at startup.
service startup is forcibly shut down: clean the tomcat cache: right click tomcat-> Clear

after clearing the cache, close the editor eclipse
and then go to the directory D:\tomcat\apache-tomcat-8.0.17\bin to close tomcat

so that is solved.
if the port is occupied, you need to modify the tomcat port, or go to the service to see who is occupying the port.

must be modified or closed. The second kind:
startup project is maven project and maven local repository is broken, not fully downloaded, jar package is missing, the code is not recognized at compile time, also will report this error.
the most simple and rude method at this time is to close the compiler eclipse to avoid other projects accidentally, and then go to the maven local repository storage location
D:\Program Files\Apache\maven\maven-repository delete all the jar package Files in this directory:

then execute the MVN help:system command under CMD, maven’s warehouse will download the Files again.

download successful:

Using NPM to install Remix error in Windows 10

ERROR for Remix installation using NPM under Windows10 environment

basic environment

node: 12.16.1
NPM: 6.13.4
git: 2.23.0

error details

gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack     at VisualStudioFinder.fail (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack     at D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack     at D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack     at D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack     at D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack     at D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:310:5)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "D:\\nodejs\\node.exe" "D:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\remix-ide-master\remix-ide\node_modules\scrypt
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

solution

Installation Remix-ide.exe:https://github.com/ethereum/remix-ide/releases

Problem: attributeerror: ‘tensor’ object has no attribute ‘creator’

AttributeError: ‘Tensor’ object has no attribute ‘creator’

according to the official pytorch documentation, the variable has the above three properties, but the error of not having this property appears when the creator property of the y operation is obtained.

import torch
from torch.autograd import Variable
x = Variable(torch.ones(1,3), requires_grad=True)
y = x+2
print('x: ', x)
print('y: ', y)
print(y.creator)

after checking, it is found that the name of creator property has been changed to grad_fn, and many documents have not been modified

on making commits: https://github.com/pytorch/tutorials/pull/91/files

after modification, run again, you can get the property Variable

of the created Function property of y

import torch
from torch.autograd import Variable
x = Variable(torch.ones(1,3), requires_grad=True)
y = x+2
print('x: ', x)
print('y: ', y)
print(y.grad_fn)

python ValueError: source code string cannot contain null bytes

pytest executes test cases with the following error

(python) D:\study\python\BasicKnowledgePoints\s5_frame\f01_pytest\f004_conftest>pytest test_01.py
ImportError while loading conftest 'D:\study\python\BasicKnowledgePoints\s5_frame\f01_pytest\f004_conftest\conftest.py'.
ValueError: source code string cannot contain null bytes

the reason is that my D:\study\python\BasicKnowledgePoints\s5_frame\f01_pytest\ init