wget showing syntax error - python-3.x

running in python console: ( Windows)
>>> "C:\Users\xxxxx\Downloads\wget-1.11.4-1-bin\bin\wget.exe" google.com
File "<stdin>", line 1
"C:\Users\xxxxx\Downloads\wget-1.11.4-1-bin\bin\wget.exe" google.com
^
SyntaxError: invalid syntax

Related

Problem with select pgsql in command line linux

I have error: -bash: syntax error near unexpected token `('
for this command:
su - postgres -c 'psql -c "(SELECT rabbit_send_msg( \'bip_events\', \'bipxx.Pixi\', json_build_object(\'source\', \'bipxx\', \'entity\', \'Pixi\', \'id\', "PIK_CLICK_ID", \'mode\', \'INSERT\')::text) FROM public."PNIKI_SIG" ORDER BY "PIK_CLICK_ID" desc)" -d trunk_dev'
query running in a normal program to pgsql:
SELECT rabbit_send_msg( 'bip_events', 'bipxx.Pixi',json_build_object('source', 'bipxx','entity','Pixi','id', "PIK_CLICK_ID",'mode','INSERT')::text) FROM public."PNIKI_SIG" ORDER BY "PIK_CLICK_ID" desc

I am getting the errors when i am running the command the qtl seq downloaded by conda. I am running following command

[QTL-seq:2019-10-09 09:13:37] !!ERROR!! bcftools concat -a -O z -o Chikpea_qtl/30_vcf/qtlseq.vcf.gz Chikpea_qtl/30_vcf/qtlseq.*.vcf.gz >> Chikpea_qtl/log/bcftools.log 2>&1
Failed to open Chikpea_qtl/30_vcf/qtlseq.NW_004516646.1.vcf.gz: could not load index
Traceback (most recent call last):
File "/home/jthakur/Desktop/Software/QTL-seq/qtlseq/mpileup.py", line 191, in concat
check=True)
File "/home/jthakur/anaconda2/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'bcftools concat -a -O z -o Chikpea_qtl/30_vcf/qtlseq.vcf.gz Chikpea_qtl/30_vcf/qtlseq.*.vcf.gz >> Chikpea_qtl/log/bcftools.log 2>&1' returned non-zero exit status 255.
Traceback (most recent call last):
File "/home/jthakur/anaconda2/bin/qtlseq", line 11, in
load_entry_point('qtlseq', 'console_scripts', 'qtlseq')()
File "/home/jthakur/Desktop/Software/QTL-seq/qtlseq/qtlseq.py", line 192, in main
QTLseq(args).run()
File "/home/jthakur/Desktop/Software/QTL-seq/qtlseq/qtlseq.py", line 123, in mpileup
mp.run()
File "/home/jthakur/Desktop/Software/QTL-seq/qtlseq/mpileup.py", line 232, in run
self.concat()
File "/home/jthakur/Desktop/Software/QTL-seq/qtlseq/mpileup.py", line 194, in concat
sys.exit()
NameError: name 'sys' is not defined

Error Installing Python Libraries through Nexus Repo Manager

I am currently trying to install two libraries.
Running: C:\Users\J39304\Desktop>python -m pip install pyinstaller yields me the following error:
> C:\Users\jerry\Desktop>python -m pip install pyinstaller
> Looking in indexes: https://repo-manager-location-proprietarysimple
> Collecting pyinstaller
>
>
> Using cached https://repo-manager-location-proprietarypackages/03/32/hash/PyInstaller-3.4.tar.gz
>
>
> Installing build dependencies ... error
> ERROR: Complete output from command 'C:\Python35-32\python.exe' 'C:\Python35-32\lib\site-packages\pip' install --ignore-installed
> --no-user --prefix 'C:\Users\jerry\AppData\Local\Temp\pip-build-env-a6x0i3h0\overlay'
> --no-warn-script-location --no-binary :none: --only-binary :none: -i https://repo-manager-location-proprietarysimple -- setuptools wheel:
>
>
> ERROR: Traceback (most recent call last):
> File "C:\Python35-32\lib\runpy.py", line 170, in _run_module_as_main
> "__main__", mod_spec)
> File "C:\Python35-32\lib\runpy.py", line 85, in _run_code
> exec(code, run_globals)
> File "C:\Python35-32\lib\site-packages\pip\__main__.py", line 16, in <module>
> from pip._internal import main as _main # isort:skip # noqa
> File "C:\Python35-32\lib\site-packages\pip\_internal\__init__.py", line 40,
> in <module>
> from pip._internal.cli.autocompletion import autocomplete
> File "C:\Python35-32\lib\site-packages\pip\_internal\cli\autocompletion.py",
> line 8, in <module>
> from pip._internal.cli.main_parser import create_main_parser
> File "C:\Python35-32\lib\site-packages\pip\_internal\cli\main_parser.py",
> line 12, in <module>
> from pip._internal.commands import (
> File "C:\Python35-32\lib\site-packages\pip\_internal\commands\__init__.py",
> line 6, in <module>
> from pip._internal.commands.completion import CompletionCommand
> File "C:\Python35-32\lib\site-packages\pip\_internal\commands\completion.py",
> line 6, in <module>
> from pip._internal.cli.base_command import Command
> File "C:\Python35-32\lib\site-packages\pip\_internal\cli\base_command.py",
> line 25, in <module>
> from pip._internal.index import PackageFinder
> File "C:\Python35-32\lib\site-packages\pip\_internal\index.py", line 41, in
> <module>
> from pip._internal.wheel import Wheel
> File "C:\Python35-32\lib\site-packages\pip\_internal\wheel.py", line 7, in
> <module>
> import compileall
> File "C:\Python35-32\lib\compileall.py", line 20, in <module>
> from concurrent.futures import ProcessPoolExecutor
> File "C:\Python35-32\lib\site-packages\concurrent\futures\__init__.py",
> line 8, in <module>
> from concurrent.futures._base import (FIRST_COMPLETED,
> File "C:\Python35-32\lib\site-packages\concurrent\futures\_base.py", line
> 414
> raise exception_type, self._exception, self._traceback
> ^
> SyntaxError: invalid syntax
> ----------------------------------------
> ERROR:
> Command "'C:\Python35-32\python.exe'
> 'C:\Python35-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\jerry\AppData\Local\Temp\pip-build-env-a6x0i3h0\overlay'
> --no-warn-script-location --no-binary :none: --only-binary :none: -i https://repo-manager-location-proprietarysimple -- setuptools wheel"
> failed with error code 1 in None
I also noticed that running a similar command, C:\Users\J39304\Desktop>python -m pip install auto-py-to-exe, results in the exact same error.
However, when I ran C:\Users\J39304\Desktop>python -m pip install keras it installed just fine.
I have already made sure that I am using the latest version of pip by running python -m pip install --upgrade pip
I have not found any resources for this error.
raise X, Y is Python2-only syntax. Somehow you've managed to install a Python2-only library to Python3 site-packages. You need to cleanup site-packages and install newer versions of libraries.

MLflow Error while deploying the Model to local REST server

System Details:
Operating System: Ubuntu 19.04
Anaconda version: 2019.03
Python version: 3.7.3
mlflow version: 1.0.0
Steps to Reproduce: https://mlflow.org/docs/latest/tutorial.html
Error at line/command: mlflow models serve -m [path_to_model] -p 1234
Error:
Command 'source activate mlflow-c4536834c2e6e0e2472b58bfb28dce35b4bd0be6 1>&2 && gunicorn --timeout 60 -b 127.0.0.1:1234 -w 4 mlflow.pyfunc.scoring_server.wsgi:app' returned non zero return code. Return code = 1
Terminal Log:
(mlflow) root#user:/home/user/mlflow/mlflow/examples/sklearn_elasticnet_wine/mlruns/0/e3dd02d5d84545ffab858db13ede7366/artifacts/model# mlflow models serve -m $(pwd) -p 1234
2019/06/18 16:15:16 INFO mlflow.models.cli: Selected backend for flavor 'python_function'
2019/06/18 16:15:17 INFO mlflow.pyfunc.backend: === Running command 'source activate mlflow-c4536834c2e6e0e2472b58bfb28dce35b4bd0be6 1>&2 && gunicorn --timeout 60 -b 127.0.0.1:1234 -w 4 mlflow.pyfunc.scoring_server.wsgi:app'
bash: activate: No such file or directory
Traceback (most recent call last):
File "/root/anaconda3/envs/mlflow/bin/mlflow", line 10, in <module>
sys.exit(cli())
File "/root/anaconda3/envs/mlflow/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/root/anaconda3/envs/mlflow/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/root/anaconda3/envs/mlflow/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/root/anaconda3/envs/mlflow/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/root/anaconda3/envs/mlflow/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/root/anaconda3/envs/mlflow/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/root/anaconda3/envs/mlflow/lib/python3.7/site-packages/mlflow/models/cli.py", line 43, in serve
host=host)
File "/root/anaconda3/envs/mlflow/lib/python3.7/site-packages/mlflow/pyfunc/backend.py", line 76, in serve
command_env=command_env)
File "/root/anaconda3/envs/mlflow/lib/python3.7/site-packages/mlflow/pyfunc/backend.py", line 147, in _execute_in_conda_env
command, rc
Exception: Command 'source activate mlflow-c4536834c2e6e0e2472b58bfb28dce35b4bd0be6 1>&2 && gunicorn --timeout 60 -b 127.0.0.1:1234 -w 4 mlflow.pyfunc.scoring_server.wsgi:app' returned non zero return code. Return code = 1
(mlflow) root#user:/home/user/mlflow/mlflow/examples/sklearn_elasticnet_wine/mlruns/0/e3dd02d5d84545ffab858db13ede7366/artifacts/model#
Following the steps mentioned in the GitHub Issue 1507 (https://github.com/mlflow/mlflow/issues/1507) I was able to resolve this issue.
In reference to this post, the "anaconda/bin/" directory is never added to the list of environment variables i.e. PATH variable. In order to resolve this issue, add the "else" part of conda initialize code block from ~/.bashrc file to your PATH variable.
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/atulk/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/atulk/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/atulk/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/home/atulk/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
In this case, I added export PATH="/home/atulk/anaconda3/bin:$PATH" to the PATH variable. However, this is just a temporary fix until the issue is fixed in the project.
export PATH=$PATH:/path/to/python/Python/2.7/bin
can be used when you are not using anaconda

Linux Error during make gobject-introspection-1.32.1

I want to install gobject-introspection-1.32.1 on my embedded Linux.
But during make this error message appear.
Do anybody now what to do?
-bash-3.2# make
[ -d gir ] || /bin/mkdir -p gir ; \
sed \
-e s,%CAIRO_SHARED_LIBRARY%,, \
-e s,%CAIRO_GIR_PACKAGE%,, \
< gir/cairo-1.0.gir.in > gir/cairo-1.0.gir.tmp && mv gir/cairo-1.0.gir.tmp gir/cairo-1.0.gir
make all-recursive
make[1]: Entering directory `/root/gobject-introspection-1.32.1'
Making all in .
make[2]: Entering directory `/root/gobject-introspection-1.32.1'
GEN g-ir-scanner
GEN g-ir-annotation-tool
GISCAN GLib-2.0.gir
Traceback (most recent call last):
File "./g-ir-scanner", line 44, in <module>
from giscanner.scannermain import scanner_main
File "./giscanner/scannermain.py", line 29, in <module>
import tempfile
File "/usr/local/lib/python2.7/tempfile.py", line 34, in <module>
from random import Random as _Random
File "/usr/local/lib/python2.7/random.py", line 881, in <module>
_inst = Random()
File "/usr/local/lib/python2.7/random.py", line 97, in __init__
self.seed(x)
File "/usr/local/lib/python2.7/random.py", line 111, in seed
a = long(_hexlify(_urandom(16)), 16)
RuntimeError: Failed to read %zi bytes from /dev/urandom
make[2]: *** [GLib-2.0.gir] Error 1
make[2]: Leaving directory `/root/gobject-introspection-1.32.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/gobject-introspection-1.32.1'
make: *** [all] Error 2

Resources