The package linter-flake8 popped up an error message
[Linter] Error running Flake8 Error: spawn
/Users/apple/Library/Python/2.7/bin EACCES.
The detailed info Atom gave me is:
/Users/apple/.atom/packages/linter/lib/linter-registry.js:154 [Linter]
Error running Flake8 Error: spawn /Users/apple/Library/Python/2.7/bin
EACCES at Process.ChildProcess._handle.onexit
(internal/child_process.js:246) at onErrorNT
(internal/child_process.js:429) at processTicksAndRejections
(internal/process/task_queues.js:81) (anonymous) #
/Users/apple/.atom/packages/linter/lib/linter-registry.js:154
I use the Mac OS system now, and I double-checked that both flake8 and linter-flake8 are installed through the terminal (the path that the terminal showed for flake8 is /Users/apple/Library/Python/2.7/bin, and I used this address for the executable path in the linter-flake8 settings). I've been dealing with this error for two days but nothing has been solved yet. I really appreciate it if someone can help. Thanks a lot!
Related
Code gives me the following errors when pytest performs test discovery. I'm using a virtual environment (Pipenv) and have the environment activated in vscode. The error occurred some time after i upgraded to vscode Juli version 2020. I have tried removing and purging code with dpkg, and deleted the extensions located in ~/.vscode/extensions. After that, I installed the June version where i previously had no errors, but the error still occurs.
Python test log:
python /home/christian/.vscode/extensions/ms-python.python-2020.8.101144/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir /home/christian/Documents/source/personalprojects/portfolioapp/services/activity-service -s --cache-clear tests
Test Discovery failed:
SyntaxError: Unexpected end of JSON input
Python log:
> ~/.local/share/virtualenvs/activity-service-aBZdkeOh/bin/python ~/.vscode/extensions/ms-python.python-2020.8.101144/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir ~/Documents/source/personalprojects/portfolioapp/services/activity-service -s --cache-clear tests
cwd: ~/Documents/source/personalprojects/portfolioapp/services/activity-service
Error 2020-08-16 17:51:49: Failed to parse discovered Test [SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at /home/christian/.vscode/extensions/ms-python.python-2020.8.101144/out/client/extension.js:39:327177
at f.exec (/home/christian/.vscode/extensions/ms-python.python-2020.8.101144/out/client/extension.js:48:935503)
at async f.discoverTests (/home/christian/.vscode/extensions/ms-python.python-2020.8.101144/out/client/extension.js:48:934976)] {
stdout: ''
}
Error 2020-08-16 17:51:49: Python Extension: displayDiscoverStatus [SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at /home/christian/.vscode/extensions/ms-python.python-2020.8.101144/out/client/extension.js:39:327177
at f.exec (/home/christian/.vscode/extensions/ms-python.python-2020.8.101144/out/client/extension.js:48:935503)
at async f.discoverTests (/home/christian/.vscode/extensions/ms-python.python-2020.8.101144/out/client/extension.js:48:934976)] {
stdout: ''
}
If I run pytest inside the virtual env, The test runs succesfully without errors - so it seems have something to do with the python extension.
Does anyone know how to fix this?
The error message indicates the output of the pytest discover test command is not conformed to JSON regulation.
And you said the pytest works well in the terminal. So could you run the command in the Python test log directly in the terminal, and to check the outputs of this command?
the command:
python /home/christian/.vscode/extensions/ms-python.python-2020.8.101144/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir /home/christian/Documents/source/personalprojects/portfolioapp/services/activity-service -s --cache-clear tests
If the outputs of this command really does not comply with JSON regulation that means the problem was caused by the pytest package, you need to fix the pytest package you are using.
If the outputs comply with the JSON regulation that means the problem was caused by the Python extension or the VSCode, as you have deleted the extension be located at ~/.vscode/extensions and reinstall the VSCode but the error still exists, so could you delete the project cache which under: C:\Users[USERNAME]\AppData\Roaming\Code\User\workspaceStorage(in windows)?
I'm using PyDev installed as an Eclipse extension (through the update site) on Windows 7 and WinPython 3.6.0.1. I can run code just fine even though the syntax checker is broken, i.e., marks as error "Undefined variable: print" lines as simple as
print("hello")
I think the issue is connected with this error I get in the error log as soon as I start Eclipse:
Error creating python process - exited before creating sockets - exitValue = (1).
This is the Exception stack trace
java.lang.RuntimeException: Error creating python process - exited before creating sockets - exitValue = (1).
ProcessInfo:
- Executed: C:\tools\winpython\3.6.0.1\python-3.6.0.amd64\python.exe -u C:\Portables\Eclipse\plugins\org.python.pydev_5.9.2.201708151115\pysrc\pycompletionserver.py 55270
- Environment:
ALLUSERSPROFILE=C:\ProgramData
[... list of all the environment variables ...]
- Working Dir:
C:\Portables\Eclipse\plugins\org.python.pydev_5.9.2.201708151115\pysrc
- OS:
Windows 7
- Std output:
- Err output:
Traceback (most recent call last):
File "C:\Portables\Eclipse\plugins\org.python.pydev_5.9.2.201708151115\pysrc\pycompletionserver.py", line 13, in <module>
from _pydevd_bundle.pydevd_constants import IS_JYTHON
ModuleNotFoundError: No module named '_pydevd_bundle'
at org.python.pydev.core.log.Log.log(Log.java:54)
at org.python.pydev.editor.codecompletion.shell.AbstractShell.startIt(AbstractShell.java:290)
at org.python.pydev.editor.codecompletion.shell.ShellsContainer.getServerShell(ShellsContainer.java:232)
at org.python.pydev.editor.codecompletion.shell.ShellsContainer.getServerShell(ShellsContainer.java:165)
at org.python.pydev.editor.codecompletion.shell.AbstractShell.getServerShell(AbstractShell.java:222)
at org.python.pydev.editor.codecompletion.revisited.modules.CompiledModule.createTokensFromServer(CompiledModule.java:372)
at org.python.pydev.editor.codecompletion.revisited.modules.CompiledModule.<init>(CompiledModule.java:176)
at org.python.pydev.editor.codecompletion.revisited.SystemModulesManager.getBuiltinModule(SystemModulesManager.java:332)
at org.python.pydev.editor.codecompletion.revisited.SystemModulesManager.getBuiltinModule(SystemModulesManager.java:1)
at org.python.pydev.ui.interpreters.AbstractInterpreterManager.getBuiltinMod(AbstractInterpreterManager.java:146)
at org.python.pydev.ui.interpreters.AbstractInterpreterManager.getBuiltinCompletions(AbstractInterpreterManager.java:118)
at org.python.pydev.plugin.nature.PythonNature.getBuiltinCompletions(PythonNature.java:1126)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getBuiltinComps(AbstractASTManager.java:1801)
at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getBuiltinCompletions(AbstractASTManager.java:1787)
at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.<init>(AbstractScopeAnalyzerVisitor.java:151)
at com.python.pydev.analysis.visitors.OccurrencesVisitor.<init>(OccurrencesVisitor.java:105)
at com.python.pydev.analysis.OccurrencesAnalyzer.analyzeDocument(OccurrencesAnalyzer.java:50)
at com.python.pydev.analysis.builder.AnalysisBuilderRunnable.doAnalysis(AnalysisBuilderRunnable.java:271)
at com.python.pydev.analysis.builder.AbstractAnalysisBuilderRunnable.run(AbstractAnalysisBuilderRunnable.java:162)
at org.python.pydev.core.concurrency.RunnableAsJobsPoolThread$1.run(RunnableAsJobsPoolThread.java:140)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
So, apparently the error is this
ModuleNotFoundError: No module named '_pydevd_bundle'
I tried reinstalling PyDev (it looks like the installation might be broken), but to no avail. Ideas?
I might have actually found the issue. I discovered the WinPython distribution I installed was "WinPython Zero", which comes with no additional packages. I uninstalled it and installed the "default" WinPython; now the debugger is working as expected. I suppose then there's some library needed to enable debugging. Maybe a more informative error message would help here, as this one I got really doesn't say much.
Funny thing, that's exactly what happens in PyCharm too: https://youtrack.jetbrains.com/issue/PY-24198
After successful installation on Pylint on my Windows OS, I am able to run it on command prompt to check any python file.
But when I integrate PyLint on Wing IDE v 5.0, I am getting below error on checking any python file
Error executing PyLint: Command failed with error=None, status=2; stderr:
python: can't open file 'C:\Python27\Scripts\pylint': [Errno 2] No such file or directory
Am I missing something to install or pre-configure. I have set the location of Pylint.bat in PATH variable already.
Trying to build the bootloader of pyinstaller by this instruction, but fail
error messages :
[37/40] cc_link: build/debug/linux/getpath_1.o build/debug/common/pyi_python_1.o build/debug/common/pyi_global_1.o build/debug/common/pyi_launch_1.o build/debug/common/pyi_pythonlib_1.o build/debug/common/pyi_utils_1.o build/debug/common/pyi_archive_1.o build/debug/common/main_1.o build/debug/common/pyi_path_1.o -> build/debug/run_d
ld: fatal: library -lz: not found
ld: fatal: File processing errors. No output written to /home/devel3/nwtham/python27/pyinstaller/bootloader/build/debug/run_d
Waf: Leaving directory `/home/devel3/nwtham/python27/pyinstaller/bootloader/build'
Build failed: -> task failed (err #1):
{task: cc_link getpath_1.o,pyi_python_1.o,pyi_global_1.o,pyi_launch_1.o,pyi_pythonlib_1.o,pyi_utils_1.o,pyi_archive_1.o,main_1.o,pyi_path_1.o -> run_d}
I try to install libz1-1.2.8,REV=2013.09.23-SunOS5.10-i386-CSW.pkg.gz from here, but it still get the same error messages. I check on the folder /opt/csw/lib and found a hyperlink named "libz.so.1" and change it to "libz.so", but I still got the same error message.
My LD_LIBRARY_PATH
/opt/csw/lib/python2.7:/opt/csw/lib:/usr/lib:/usr/local/gcc/lib:/usr/local/lib:/usr/sfw/lib:/usr/dt/lib:/usr/openwin/lib/:/usr/ucblib:/opt/sybase/lib
Maybe I install a wrong package, which package should I install?
Python2.7 and gcc4.9.2 all download from here.
edit :
part of the PATH :
/usr/bin:/usr/local/bin:/opt/csw/gcc4/bin:/usr/sfw/bin:/opt/csw/bin
I have a project I'm trying to test and run on Jenkins. On my machine it works fine, but when I try to run it in Jenkins, it fails to find a module in the workspace.
In the main workspace directory, I run the command:
python xtests/app_verify_auto.py
And get the error:
+ python /home/tomcat7/.jenkins/jobs/exit103/workspace/xtests/app_verify_auto.py
Traceback (most recent call last):
File "/home/tomcat7/.jenkins/jobs/exit103/workspace/xtests/app_verify_auto.py", line 19, in <module>
import exit103.data.db as db
ImportError: No module named exit103.data.db
Build step 'Execute shell' marked build as failure
Finished: FAILURE
The directory exit103/data exists in the workspace and is a correct path, but python can't seem to find it.
This error exists both with and without virtualenv.
It's may caused by your PATH setting not right in jenkins environment.In fact , the environments for your default user and jenkins-user are not the same.
You may try to find what are the PATH and PYTHONPATH in your jenkins-user environments .
Try to run "shell commands" in jenkins "echo $path" and so on to see what's them are.
In most of time , you need to set the PATH by yourself.
You may reference this answer.
Jenkins: putting my Python module on the PYTHONPATH
Faced the same issue.
For others who are reading this, Run the build in your master node. It fixed the problem for me.
Running the build in the slave node doesn't give proper access to all the python modules and other commands such as jq to the workspace.