I generate a standalone file from a project using pyinstaller -F lpxl_handler_simp.py. It generates the file and executes well in the dist/ directory till I get the file to another directory. The moment I drop it in another directory and try to execute it through the Linux terminal, I get the -bash: ./lpxl_handler_simp: Permission deined error message.
I tried the pyinstaller -D lpxl_handler_simp.py option as well it gives the same error. Here is my spec file:
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(
['lpxl_handler_simp.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='lpxl_handler_simp',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
Any suggestion to help this issue is greatly appreciated.
I recommend to give it the permission using the command chmod.
If it's not working try to use chmod while being in super use sudo su.
Related
TL;DR I can't seem to find the temp files created during my airflow dag run no matter what I do.
Hello Folks,
I'm working with an Apache Airflow(1.10.12) system on Ubuntu 20.04.
My process is simple
Download FTP Files
Split lines of files and collect into separate files due to what's in the line
For the "Download" step, I'm choosing to download the files to a temp directory which I create with the following BashOperator:
create_temp_dir_command = 'pwd ' \
'&& tmp_dir=$(mktemp -d -p /var/tmp ' \
'-t ftp-$(date +%Y-%m-%d-%H-%M-%S)-airflow-wexftp-XXXXXXXXXX) ' \
'&& echo $tmp_dir'
t2 = BashOperator(
task_id='create_temp_dir',
bash_command=create_temp_dir_command,
xcom_push=True,
dag=dag,
)
Because I'm in development, I'd like to inspect the files. However, the files never seem to exist on the server. My logs look like this:
INFO - Temporary script location: /tmp/airflowtmp_vhpdkgo/create_temp_dirxjyod2h5
INFO - Running command: pwd && tmp_dir=$(mktemp -d -p /var/tmp -t ci-$(date +%Y-%m-%d-%H-%M-%S)-airflow-wexftp-XXXXXXXXXX) && echo $tmp_dir
INFO - Output:
INFO - /tmp/airflowtmp_vhpdkgo
INFO - /var/tmp/ci-2020-10-16-11-18-48-airflow-wexftp-Ro0onvw0mq
When I try to change into any of the directories listed, in the logs, I get that they don't exist.
I've tried checking the size of the files downloaded to disk, and they do have a size so they do exist.
Why are these directories so invisible and untouchable, even when I'm in a root shell?
Any help is greatly appreciated.
EDIT: I have a single node setup. So the scheduler and workers are the same instance.
I've recently updated to macOS 10.15.1 (Catalina) and switched to zsh. I then couldn't launch jupyter notebook from the command line. zsh couldn't find jupyter. There wasn't a zshrc file either. So I created one, added the code below from my bash_profile and saved it. After executing source .zshrc I still get the error - zsh: command not found: jupyter. Where am I going wrong?
# added by Anaconda3 2019.03 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/anaconda3/etc/profile.d/conda.sh" # commented out by conda initialize
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
I am trying to run an .exe that sits on a remote machine with PSEXEC, but it does not run properly.
The exe is a converted python script:
usage: WindowsUpdates3.exe [-h] [-v] [-m] [-i] [-u] [-r] [-s SKIP]
List, download and update Windows clients
optional arguments:
-h, --help show this help message and exit
-v, --version Show program version and exit
-m, --list-missing List missing updates
-i, --list-installed List installed updates
-u, --update List and install missing updates
-r, --reboot Reboot after installing updates if needed
-s SKIP, --skip SKIP Skips these KB numbers
I am able to run the .exe as intended with a PSEXEC console session:
PSEXEC \\<hostname> cmd
Navigate to the exe my.exe -i, run it and it works the same way if I execute it on the machine locally.
When I try to execute the file directly some fucntionality does not work
PSEXEC.exe \\<hostname> -h "C:\WindowsUpdates\WindowsUpdates3.exe" -i
...
C:\WindowsUpdates\WindowsUpdates3.exe exited on <hostname> with error code 0.
I am able to get the help-menu (-h) and the version (-v) of the exe with the above command.
The other arguments don't return anything but code 0 and the --update argument throws a com_error: -2147024891, which translates to access denied...
How can this be as I have the same privileges as if I spawn a cmd terminal?
In dev environment (windows) using xampp my pdf files are generated successfully, but in prod (linux):
string(545) "The exit status code '126' says something went wrong:
stderr: "sh: /home/trainingexperience/beta.trainingexperience.org/app/../bin/wkhtmltopdf.exe.bat: Permission denied"
stdout: ""
command: /home/trainingexperience/beta.trainingexperience.org/app/../bin/wkhtmltopdf.exe.bat --lowquality --encoding 'utf-8' '/home/trainingexperience/beta.trainingexperience.org/app/cache/prod/snappy/knp_snappy5936b3644fdf62.71499624.html' '/home/trainingexperience/beta.trainingexperience.org/app/../web/uploads/company/payments/test_cXrfA4L99zsiKi6Cfl5a.pdf'."
My config:
knp_snappy:
pdf:
binary: %kernel.root_dir%/../bin/wkhtmltopdf.exe.bat
temporary_folder: %kernel.cache_dir%/snappy
Could it be because of Linux? What is the problem?
UPDATE
I tried:
knp_snappy:
pdf:
binary: %kernel.root_dir%/../bin/wkhtmltopdf
temporary_folder: %kernel.cache_dir%/snappy
I got:
No such file or directory
I think could be the problem (composer.json): "wemersonjanuario/wkhtmltopdf-windows": "0.12.2.3". Is there a version to that could work on windows and linux at the same time?
You should define a shell executable for your production environement and your developement environment.
for linux
binary: /usr/local/bin/wkhtmltopdf
for windows
binary: "C:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltopdf.exe\\"
as you can see, You can't sh (execute) a .bat file on linux.
The following command is run from the Windows command line and it works sometimes, but it does not in other occasions.
GPG --recipient "my.puclic.key#recipient.com" --output "MyEncryptedFileName.txt.PGP" --encrypt "MyTestDocument.txt Working Directory: \\myServer\myfolderName\
The directory and file name exist, but it seems like GPG can't find them. I have also tried the command as..
GPG --recipient "my.puclic.key#recipient.com" --output "MyEncryptedFileName.txt.PGP" --encrypt "MyTestDocument.txt Working Directory: \\myServer\myfolderName\"
and
GPG --recipient "my.puclic.key#recipient.com" --output "MyEncryptedFileName.txt.PGP" --encrypt "MyTestDocument.txt Working Directory: \\myServer\myfolderName"
but keep getting an error:
"can't open 'MyTestDocument.txt Working Directory:\\myServer\myfolderName\': No such file or directory
gpg MyTestDocument.txt Working Directory: \\myServer\myfolderName\: encryption failed: No such file or directory
In prior occasions this same command worked fine.