xlwings with an error message about PYTHONPATH and interpreter - xlwings

I am wondering if there was anyone experiencing similar issue that I had.
I am trying to run main from my .py file on Mac OS and it shows the following message.
"sh:/Users/~
Permission denied"
I wish to delete the file path on both interpreter and PYTHONPATH but the directory entered previously keeps on showing. Does anyone know how to remove or reset or resolve this error? Thank you so much for your help!
error message when run main was executed
directory entered not disappearing

Related

Termux says "'Bad Interpreter: No such file or directory"

I have a problem and hope someone can help me. I am currently trying to write a script for Termux or Termux:Task. My script currently looks like this:
#!/data/data/com.termux/files/usr/bin/bash
cd /./sdcard/www/public/
wp post list sleep 5
Every time I load the script I get the following error message:
/data/data/com.termux/files/usr/bin/wp: /usr/bin/env: bad interpreter: No such file or directory.
I've been looking for a solution to my problem for hours, unfortunately without success.
I am using an extension for Termux called "WordPress CLI". When I start termux and enter the commands individually, everything works. But as soon as I write the commands into a sh script and start it doesn't work anymore. :(
Can anyone help me?
Thanks a lot
This is simple error you can fix it by replacing !/data/data/com.termux/files/usr/bin/bash. With #!/data/data/com.termux/files/usr/bin/bash
Please tell if you get error again
Try with #!/usr/bin/env bash in the shebang line.
Termux-exec allows you to execute scripts with shebangs for traditional Unix file structures. So shebangs like #!/bin/sh and #!/usr/bin/env python should be able to run without termux-fix-shebang.
From https://wiki.termux.com/wiki/Termux-exec
According to doc:
Why do I keep getting a '/bin/sh bad interpreter' error?
This error is thrown due to access script interpreter at nonexistent
location.
Termux does not have common directories like /bin, /sbin, /usr/bin at
their standard place. There is an exception for certain devices where
/bin is a symbolic link to /system/bin, but that does not make a
difference.
Interpreters should be accessed at this directory only:
/data/data/com.termux/files/usr/bin
There are three ways to fix this:
Install termux-exec by using pkg install termux-exec. It won’t affect the current session, but after a restart should work without
any setup. Not needed if your Termux is up to date. If still not
working, try the next workaround.
Use command termux-fix-shebang to fix the shebang line of specified file.
Use termux-chroot from package proot to setup a chroot environment mimicking a normal Linux file system in Termux.
termux-fix-shebang my_script.py of second method work for me, which it modify the shebang(first line of my_script.py) from #!/usr/bin/env python to #!/data/data/com.termux/files/usr/bin/env python. Since /usr/bin/ is not exist in Android, that's why it throws the error /usr/bin/env: bad interpreter: No such file or directory. The other solution is run with python my_script.py, neither of my_script.py nor ./my_script.py.
In my test, termux-exec of the first method only work if I added correct shebang in main script(child OR child of child script no need) and ran command export LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so.
And for the issue of this question, error shows /usr/bin/env in the middle with /data/data/com.termux/files/usr/bin/wp even though the shebang of script #!/data/data/com.termux/files/usr/bin/bash looks ok, it means that wp command (located at /data/data/com.termux/files/usr/bin/wp) used inside the script contains shebang #!/usr/bin/env wp and should modify it to #!/data/data/com.termux/files/usr/bin/env wp too. termux-exec of first method should fix this specific case too(already has correct shebang in main script).

pycharm + flask surprising working directory

(Modified to answer the questions in the first comment.)
I am using Flask in PyCharm and getting different results than when I run it from the terminal. In particular, the working directory of the Python program is different under Pycharm. So this code works correctly when running flask from the command line and the print os.getcwd() displays '/Users/Wes/Dropbox/Programming/Python/etpruncnt2'.
However if I run the same code in Pycharm the os.getcwd() displays '/Applications/PyCharm.app/Contents/bin' and the file open fails
with IOError: [Errno 2] No such file or directory: 'data/results.json'.
The root of the project in PyCharm is /Users/Wes/Dropbox/Programming/Python/etpruncnt2. I have also added a screenshot of the project structure in the PyCharm GUI.
I suppose I must have the configuration wrong in PyCharm. I have included a screenshot.
What should I do?
#app.route('/running_count')
def running_count():
print os.getcwd()
with open('data/results.json', 'r') as resultFile:
resultData = json.load(resultFile)
return str(resultData)
You Only Have Shown Script Path
How is project structure ? When you are creating new project you are telling pycharm the project root and may you mixed that part :)
I am going to close this. The immediate problem is that the Working Directory in the config was not filled in.
Most default setups for PyCharm do fill that in, but the setup for flask does not.
I have filed a low-urgency bug report with IntelliJ.

Error Code 2318 in Bluestacks

I am trying to install bluestacks on my local machine, however I am getting error code 2318.
To fix it, I deleted the folder it installed and then tried to completely uninstall the application. When doing so, I again got this 2318 error code.
How do I resolve this error?
please try again later and delete all the items of bluestack.
and then restart your computer.
then may be it

I can run my script from idle but not from python.exe?

When I run my script from Idle my program runs perfectly, but when I run the .py file and it spawns a shell # C:\Python27\Python.exe my program fails with the following error:-
IOError: [Errno 13] Permission denied: 'my new file.html'
And the bit of code is:-
f = open("my new file.html", "w")
I have searched for this IOError but the things people are saying don't appear to tie in with what I am doing, which is writing out a file?
If it says "permission denied", that's telling you that you don't have permission to create that file. It isn't lying to you. The first rule of debugging is to always assume the error is telling you the literal truth.
Since you didn't supply a folder in the filename, it's trying to create a file in the current directory. You are probably in a protected folder. If you cd to a folder where you have write permissions, the problem will likely go away.

Dajaxice not being parsed by template renderer?

Well i recently put my site into production and this is the last of a few bugs i need to fix. Basically dajaxice/dajaxice.core.js in returning this error in console Uncaught SyntaxError: Unexpected token %. I have placed that particular folder into static and run collect static. The file is fetched however upon opening up the file from the error the django code embedded within the file is not being rendered.
I have placed the file wihtin the head of my base file. Does anyone have any suggestions as to why this is occuring. In my local envionment (development) it is working flawlessly. The only difference i had when installing the two is that i used pip to install it on production and on local i directly downloaded the file and installed it from github. How do i find the version of Dajaxice that is installed?
Does anyone have any ideas as to why this is occuring?
Thanks