Python script works for one user, but not another on same machine - python-3.x

Another team created python scripts within our organization for my team to run. Up until two weeks ago, we all ran them without any problems. Then one day, some users have been unable to run them successfully on the same machine.
All users are admins with LUA disabled. All users should have the same permissions.
The complicating factor here is the team created a "framework" which generates code from a combination of the framework, and an excel file for the tests being run. This prevents me from stepping through the code and finding where it's specifically failing. Beyond that, the same exact script runs on the same machine when another user trying to run it.
Specifically, in the script, it appears that when the affected users are running the script, IEDriverserver doesn't appear to open. No errors are given.
Is there any environmental variables that could be specific to users that would cause this? Even a direction to look would be extremely helpful.

Does it always fail in the same part of the Python code? Does opening the Excel file have anything to do with it, perhaps? I mean, if someone has the Excel file open on a network drive, and someone else is trying to write to the file, i'm pretty sure this will trigger an error, unless the Excel file is 'shared'. Just a couple thoughts.

I encountered the similar issue today. I happen to solve it by unset PYTHONHOME and PYTHONPATH. Not sure if this helps.

Related

Setting desktop backgrounds via Azure Storage Containers using PowerShell not working

I'm trying to set desktop backgrounds for our users from Azure Storage using a PS script I'm hoping to deploy.
This script
It just isn't working!
For whatever reason, the script just stops calling at a certain point (line 142 onwards) and I can't work out why.
I've added Write-Hosts at certain points to see where it's getting to and it seems to be that return $Bloblist which doesn't run or go any further.
I can see from the logs that it's showing 'Adding content file from Azure Storage Blob to return list: Background-01.png' etc., but that's it. This tells me that is not a permission error as it is looking where it needs to.
I just can't work out why it's not returning that Bloblist.
If anyone could help that'd be super, as we need to change the desktop backgrounds for every user in the company due to a company name change.
Thanks a lot!
The problem is (probably) not with the script. The problem is likely due to a setup misstep.
You need to debug the code and find out where it's failing to do what you expect.
You could try this or if videos are your thing you could try this.

Autorun Excel / Macro on schedule

I have a workbook that contains a macro that I would like to run once a week automatically.
I have set up the workbook_open event to run the macro and the code itself runs as I would like it to.
My question is how to schedule this to automatically run on a schedule. I have setup a task in windows task scheduler which does not seem to run reliably (i've tried this on a few different projects over the years and never get great results).
My desire is to have my personal desktop run this task whether or not I am logged in. (Obviously the computer needs to be powered on which is no problem. Also, I am the only one that uses this computer, no concern about someone else being logged in)
Is there a more robust way of doing this or am I stuck with task scheduler? If so, has anyone else had better success with it that might be able to help me out?
Task scheduler seems to work only intermittently although the "history" shows it is triggered and run at the desired times. Part of the code saves a file to a location with a date stamp and there are not files for each trigger in the scheduler history.
When logged off , the task is executed without loading the user profile.
Maybe this is the answer for you.
It's Japanese. Can you use google translate?
enter link description here
You have to make the directory.
If you use 32bit Excel : %SystemRoot%\System32\config\systemprofile\Desktop
If you use 64bit Excel : %SystemRoot%\SysWOW64\config\systemprofile\Desktop
For anyone that might run across this. I've been using a 3rd party task scheduler which is much more reliable in my experience. There are many out there but i use robointern. robointern website

Package Python 3 executable that does not require programming knowledge

I would like to send my Python3 script to my father-in-law and grandmother. Each has their own Windows machine, one is running Windows 7 and the other is running XP.
Not sure how to package it up for them to run on their respective machines. Is there such a method?
My script prompts, while in the IDE environment, for Keyword, path, filename. So there are some inputs, the user has to type in. Not sure if that will affect the portable script creation.
After reading through some responses here on StackOverFlow, I found py2exe does not work with Python 3.
Also Pytonw, suggested here as well, looks very complicated. I don't think either of my relative could carry out those steps.
Lastly CX-Freeze site I get ublock filters-Badware risks and a big warning window when I visit their website.
I've used cx-freeze to deploy python apps compiled to windows .exe files for us by computer novice users for several years and it has worked well. you will occasionally run into issues with dependencies you will have to take extra steps for (Datetime for example) but nothing that isn't surmountable. The easiest way to handle it is to install the folder on the computer yourself and create a desktop shortcut to it for the user. That keeps it simple for them. If you are not close to them you can always use a program like team viewer to gain access to their computer like remote desktop.

Which files required for qt 5.4 qwebchannel linux deployment?

All,
Have a QtWebEngine based application which uses all local html and javascript files. When deploying this to a test environment the Web page comes up and is navigable, but, webchannel based things aren't working. Everything is fine on development. Problem only happens on deployment to test machine.
This is a self contained .deb which installs creating a user and is meant to bring everything along with it. While it is running on a desktop, there is no network connection, everything is inside.
That said, if "everything" was inside the webchannel would be working. Does anyone have a link identifying what external pieces webchannel requires? There are only two oddities starting up on the target.
[0629/132921:WARNING:resource_bundle.cc(286)] locale_file_path.empty()
[0629/132921:WARNING:resource_bundle.cc(286)] locale_file_path.empty()
Trust me, I've surfed for that. There are thousands of posts flagging resource_bundle.cc throwing local_file_path.empty() errors at all kinds of lines and nothing offered as a solution. I am making the grand assumption when webchannel supporting files are identified and placed/pointed to, these will go away and life will be good.
qwebchannel.js is deployed, but, maybe there is an environment variable I need to set? the index.html file references qwebchannel.js exactly where it is.
Anyone have the list/link of what files are required when deploying something using qwebchannel.js? It isn't throwing up an error which identifies much.
Thanks,

IIS executable not executing

I have been looking at an issue for a week straight and have been unable to figure it out and I am desperate for the fix.
On a client site, we have two environments: UAT and PROD. UAT works perfect (Please keep this in mind). We are now trying to deploy the solution to PROD but certain parts of the solution are not working.
We have developed an asp.net application that we provide to clients to allow them to invoke SSIS packages (there are a couple of drop downs that they first select then click a button named "invoke").
When the user clicks the Invoke button, a batch file named InvokeSSIS.bat is called that assembles a command line call to dtexec with the appropriate parameters.
I'm having a problem with a particular package that is responsible for calling an executable which generates a spreadsheet that i will be importing into my system.
The executable is on an mapped H:\ drive.
I have modified the InvokeSSIS.bat batch file to capture the command the batch file is generating. If I execute this command from the command line, it works perfectly. From the webapp Invoker, it executes the package but the tasks responsible for calling the executable doesn't execute as the entire package takes only 1 second to complete (whereas it should take about a minute.)
The executable DOES have a GUI, but it is NOT interactive. This is because when you call the GUI with specific parameters, it automatically runs in batch mode and executes a macro used to generate the desired spreadsheet.
I know this is ok because it works on the UAT server AND it works from the command line!
I have checked the permissions on the executable (bu right-clicking the executable and clicking properties.) I have granted Full Control on the executable to the same user specified as the identity tab of the application pool i am using.
Can someone please help me? As I said I am dying over here!
Please let me know if you have any ideas or what other info you need.
Environment (both UAT and PROD)
OS: Windows Server 2003
IIS 6
asp.net 2.0
SQL Server 2008
Thanks!
Steve
You can't use a mapped drive with IIS.
You must use the \\servername syntax to reach files on other systems.
I agree with user544284 that this is at least in part a mapping issue. I'll ignore for a minute the complete insanity of having a web application call a batch file to start an executable that's on a remote network drive through a drive letter mapping.
Most likely the UAT box has something set up that maps that drive letter for you which Prod is missing.
The only other possibility is a security violation is occurring. Running .exe's from a network drive is generally frowned on. Do the two environments have the exact same version of windows? Are they configured the same with regards to UAC? Any differences here are going to be important.
Which brings up an interesting thought. I wonder if someone logged in to the UAT server using the same account credentials the app pool is using and added the ip address of the machine where the exe lives to the list of "Local Intranet" sites... Or, if they installed SSIS on the UAT server itself.
Just because YOU can log in to the server and run it on the command line means nothing. You have to find out if the drive letter is mapped at all for the user that the web app is running under and whether that user has the required security bits and whether the local OS will allow it regardless.
Okay, I can't ignore it: hairbrained is the nicest adjective I can come up with for this "architecture". Do yourself a favor and go back to the drawing board on this one. It has the word "brittle" written all over it, as you have already found. Instead of building out a batch file to call dtexec, just do it directly either by something like this or this.

Resources