ghci only loads with admin - haskell

I've been trying to install Haskell platform with chocolatey but have been unable to get it working without running the command prompt as an administrator.
When I do so normally it just states that "ghci is not recognized as an internal or external command", but when I do so with admin privileges' it works fine.
I looked at this thread and attempted to add the pthread.dll file to my system but this seemed to just make the program run worse as admin. I'm confused why something that should be so basic as setting up a programming language is giving me so much headache

Ok, managed to fix it by making an environment variable directly to my C:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.10.3\bin location.
I thought making an environment variable to C:\ProgramData\chocolatey\ would have been sufficient but clearly not. Weird too as Chocolatey added many of its own environment variables but not one that pointed to gchi

Related

Apache Won't Start, Encodings cannot be found

There are a lot of similar questions noting that they could not get Apache (2.4) started due to improperly created "PYTHONHOME" and "PYTHONPATH" variables.
I have installed mod_wsgi, I am using python 3.8.0, I am on Windows 10 x64 and have x64 bit installations of all my modules. When I start Apache, though, (httpd -k start, restart) the service does not start. I tried manually doing the same in the services tab of Task Manager, it also immediately stopped after I tried to run Apache.
Looking in the logs, it seems my issue is also related to the aforementioned variables, however in other peoples' cases, they were advised to remove the variables whereas it seems mine are not set to anything in the first place. I had read that setting these variables inadvertently masks system variables, but that does not seem to be the case for me.
The most explicit error in the logs seemed to be of the "encodings" module not being found. I have attached a screenshot of the log below.
Can anyone help me get Apache24 running?
P.S. I am using Apache Haus Distribution, I believe the name of the installation I have is.
Error.log Report
Yes, this error is reported when PYTHONHOME does not have a valid Python installation.
This answer may help: https://stackoverflow.com/a/69949005/2850706

Go back and forth between environments in a script (e.g., Jupyter Notebooks)

I'm very confused in regards to whether it's possible to switch between environments in one script. I'm currently working Jupyter Notebooks and realized I do need a package that is in a separate (non-root) environment and would like to be able to import/use it. I initially tried to just load it into my root env, but it has so many conflicts, it's not possible. So trying to switch env mid script- is this not possible without going through hoops and going through Anaconda prompt? I've looked at about 30 articles and/or stackoverflow pages and it seems like my only option is to add my environment to the default sys.path within Jupyter OR potentially create another environment that contains both environment packages. This suggestion was unclear...not sure how to run this and I don't want to run through a shell/prompt either.
These were good resources:
RealPython: On Virtual Envs
StackOverflow: In which conda env is Jupyter executing?
Any clarity I can get on the topic for someone who doesn't understand this well, would be appreciated (Please explain as if I'm a Level 0/Beginner).
Now I'm looking back on this old post, thought I'd answer it since it never got an answer. While it's extremely frustrating to realize that needed packages don't mesh together mid-project, for each significant project, a new environment should be created. I still have a general environment that I use for minor projects, but for situations like this, I use anaconda's cheat sheet to make sure that in the new environment I'm creating, packages will all sync together by specifying versions directly in the creation in the environment. Also, getting comfortable with creating/copying .yml files and loading them directly into conda have also been helpful.
conda env create --file envname.yml
Once that's done, if I'm using jupyter notebooks, making sure it's been established as a kernel has been important.
Of course, if you're using an IDE like pycharm, you can bypass the conda prompt (pycharm is still talking to conda), which is sometimes just easier if you're on a deadline rather than going back and forth between different software.

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.

Run a windows service with uiaccess flag

I have a program that I want to display a window above the start screen in Windows 8. The only way to do that (that I know of) requires I set the flag uiaccess=true in the manifest. But, in order for that to work, the user of the program needs to be an administrator. So, I tried this method to get a service I install with the program to launch the main program. This way the any user can run the program once installed.
The problem is the uiaccess flag. It seems that in order to launch a program as described in the article, but with uiaccess, the service itself needs to have the uiaccess flag enabled (or else CreateProcessAsUser fails). And whenever I try to install the service with the uiaccess flag, I get the error "this process requires elevation."
So, the main question is: Is there a way to install a service that has this flag enabled? I admit that I expect the answer to be "no". Since a service running in session 0 would normally have no reason to have this flag, since there's no ui component allowed. But, I'm hoping that I'm wrong and there is a way.
Thank you, let me know if I need to clear up anything.
Before CreateProcessAsUser and after DuplicateHandle use function SetTokenInformation with TokenUIAccess 1

Same program behaves differently in different consoles

I wrote a text mode batch C++ program that since today is giving me some troubles.
The executable worked correctly and it did not change.
The environment did not change; not even a reboot.
When I launch the program from a certain console, everything is fine.
When I launch the program from a new console, everything still works, but I get just the first two lines on the log file, even if the execution completes.
The parameters passed to the executable are the same.
The executable does not interact with the console in any way.
The two consoles' environment variables are the same.
When run from a remote computer as root, everything is fine, the log file is complete.
When logged in again with my user, from another session, everything is fine again.
When logging out and in again, everything is fine again.
So, could it be the from a certain instant on, the new consoles had some issues that caused this problem?
Could this be a problem of my Linux installation?
Or, more realistically, could the problem depend on my program?
Thank you!
Environment:
- Linux OpenSuse 11.4
- gcc 4.5.1
Here is another tool to throw into your debugging toolbox.
Try the command 'reset' -- read the man page for details.
In short, it resets the console to a known state. It is ... possible that your log files may contain control characters that try to interact with tty causing hard-to-trace problems.
You might also want to look at the command 'script' which captures all console activity to at et file for examination.

Resources