Using ipython on a different linux account: command gets stuck - linux

I installed miniconda3 on one linux account, then I created an environment py37, installed all the needed packages and was able to launch ipython from the second account and import the package I wanted to import: hail. For that I changed all of the permissions in the folder with miniconda3 to 777. Somehow, the command when run on the second account gets stuck, but when executed on the initial one where miniconda3 is installed, it runs successfully:
import hail as hl
---> mt = hl.balding_nichols_model(n_populations=3, n_samples=50, n_variants=100)
mt.count()
The middle command gets stuck. No error, it is just not returning. When I run hl.balding_nichols_model on the original account, it is also giving me a warning (but runs successfully, giving the result in mt.count()):
WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
And the thing is that on another account where the command fails I have Hadoop mounted. So, I have a slight suspicion it is somehow related. I am totally stuck, so would appreciate any suggestions. I need to do it this way - installing miniconda3 on one account, then accessing it from the other - because on the first account I have terabytes of data free, but on the second - 4Gb and it can't be further expanded unfortunately. With miniconda3 I would quickly go over the limits.
Additional info regarding the actual software can be found here:
https://hail.is/docs/0.2/getting_started.html#installation
Update
I installed separately python37 on the conda present on the node and somehow it does not work either, so it is not the problem of permissions, and the issue now is limited to that particular linux account. I installed spark2.4 but that did not fix the issue. So, the middle command in the python script gets stuck and I do not know even how to get the log output, what is going on there.

The answer to the 'stuck' issue can be found here:
https://discuss.hail.is/t/spark-2-4-4-gets-stuck-in-initialization-phase/1178
I asked it on Hail forum and then replied myself there after we fixed the issue. It turned out to be space issue: hadoop and spark logs should be redirected to different places when you do not have enough of space at the partition you are working on.

Related

Task Scheduler for running python script done in PyCharm - Anaconda environment

I have created several scripts in PyCharm, inside an Anaconda3 environment. The thing is that I would like to run them with the task scheduler during the night, so hopefully by the time I get up they have done their stuff.
I have read a million post in Microsoft support and in here, and I haven't found an answer for this issue.
This is a print of the set-up for the Task Scheduler:
For the program, I use the path to python.exe inside anaconda ( I take this path from cmd / where python).
Start in: the route to the script: C:\Users\oper\PycharmProjects\MyProject
It doesn't run, and it brings the error: 0x1. Opens a CommandPrompt windows and immediately closes it. I see the error in: Last Run Result.
I have been able to run a much simpler code that prints a .txt in a specified folder - but not this one.
Additional info:
this script runs a Selenium WebDriver and navigates some websites, connects with Google's OCR, etc. All these steps are written in several other modules for ease of coding.
All the libraries used were installed using pip inside PyCharm's terminal. Might be related to not having the libraries in sync? Don't know how to check that.
I would also like to set up a wake-up from sleep for the computer. Probably a different problem for another question.
Thanks in advance.

External Control Universal Robots With Ros2 Foxy (PYTHON)

I am attempting to control my ur10e COBOT using ros2 but I have run into some issues.
I followed the steps of the ros2 install.
https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html
Then I installed MoveIt2 Foxy. https://moveit.picknik.ai/foxy/doc/move_group_interface/move_group_interface_tutorial.html
Then downloaded UR-ros2-driver.
https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/tree/foxy
One of the issues I ran into with the UR-ros2-driver download was since I'm using foxy, I had to download the ros2-control-demos found in this link https://github.com/ros-controls/ros2_control_demos/tree/foxy
And after removing files in the /workspace/install folder I was able to launch the trajectory program and it ran great. The files I removed were...
(controller_manager_msgs)
(diffbot_description)
(hardware_interface)
(joint_limits)
(ros2_control_demo_hardware)
(rrbot_description)
Okay now after I bore you with all my startup steps, now lets get into some code. Once everything was downloaded, I first had to source my files in the terminal...
source /opt/ros/foxy/setup.bash
source ~/workspace/ros_ur_driver/install/setup.bash
Then I launched...
ros2 launch ur_bringup ur_control.launch.py ur_type:=ur10e robot_ip:=yyy.yyy.yyy.yyy use_fake_hardware:=true launch_rviz:=true
Which ran great and I was able to see my COBOT model in rviz2.
Next, in a second terminal, I launched...
ros2 launch ur_bringup test_joint_trajectory_controller.launch.py
And watched while the virtual COBOT moved to the command.
Now, to make a long story short I managed to get the my PC and the COBOT pendent connected by setting up the COBOT's IP address with my PC's IP address. No issue there.
WHERE MY PROBLEM IS
I went to launch the IP adjusted code...
ros2 launch ur_bringup ur_control.launch.py ur_type:=ur10e robot_ip:=192.168.56.2 launch_rviz:=true
And my model was stuck colorless and crunched up. I'm unable to interact with the virtual COBOT at this Error state. I do recall this happening with my fake_test version when I would forget to source it properly before I launched it. So I was thinking maybe I messed up in the way I sourced my files. Or maybe I didn't add the control_demo packages correctly. If someone could give my some pointers on this that'll be greatly appreciated.

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

Python was not found but can be installed

I have just installed python3.8 and sublime text editor. I am attempting to run the python build on sublime text but I am met with "Python was not found but can be installed" error.
Both python and sublime are installed on E:\
When opening cmd prompt I can change dir and am able to run py from there without an issue.
I'm assuming that my sublime is not pointing to the correct dir but don't know how to resolve this issue.
This isn't a Sublime issue, it's a Windows 10 issue. My Windows 10 boxes don't have this feature so I'm not sure how widely spread it is, but you may want to check out this (seemingly unrelated) question "Permission Denied" trying to run Python on Windows 10.
The general gist from this post is that these new stub redirectors are supposed to direct you into installing some missing applications from the Windows App store and that user-installed versions are supposed to take priority, but depending on how the PATH is modified the system might find the stub versions before your user installed versions.
The currently accepted answer mentions:
The second part of correcting it is to type "manage app execution aliases" into the Windows search prompt and disable the store versions of Python altogether.
It's possible that you'll only need to do the second part, but on my system I made both changes and everything is back to normal now.
In the comments, there are comments from Zooba which further indicate that this is the way to go:
(Microsoft employee and CPython core developer here) You definitely only need to do the second part. There have been a couple of bugs related to upgrading apps resetting aliases which will be fixed in the next stable update, so it should be a one-time fix by then. While you're getting Insiders updates you may need to do it a couple more times.
... And launching the Store is a new feature to help people install Python - if you've added it to PATH using the regular installer it should take precedence over the new redirector, but if not you've discovered above how to disable it.
i had the same problem, so i went to the microsoft store (windos 10) and simply installed "python 3.9" and problem was gone!
sorry for bad english btw

Setting up development environment in Windows 10 without admin rights

Let me give a quick background of the work I do and then I'll explain the problem I am facing.
I am a software developer with more than 15+ years work experience. My work involves a lot of varied tasks:
data analysis using R, Python
development of web applications using Ruby on Rails, JS, etc.
building models using open source libraries
So far, I have been doing all this in my personal laptop (Ubuntu 18.04) and have faced no issues.
But I would soon need to start using a laptop provided by the organisation that I am working for. This org is not a IT company, it's a public body. They only use Windows (10) and don't provide admin access to anyone. It's very hard to get permission to install any kind of "approved" software. Just to give an example, they refused to install Chrome in my laptop as they wouldn't be able to control the updates.
So here's my problem - what do I do to work peacefully using their laptop? The primary reason I have to use the work laptop is that there are a lot of important documents kept in shared drives that are accessible only in their machines.
I have been looking at options like WSL or Hyper-V. But, before I put in a request to the IT team to get them to agree, I wanted to know a few things:
1) Which among WSL or Hyper-V would be the better approach for setting up the dev environment that I want?
2) IF I get the IT team to install WSL/HV, would I be able to set up everything else without having to go back to them for each software? Is there a way of secure local admin access these options would provide that will ease their concerns?
3) Is there some other way of setting up what I want?
If still applicable and actual I can share my solution:
If you should work on a windows machine where you don’t have administrative privileges, you can very easily make a portable R/Rstudio installation.
Download a recent version of R from the CRAN site and the recent version of RStudio. After download extract RStudio installation exec with 7Zip and copy files from $_OUTDIR to the desired location (in case you making an update, simply overwrite all files, that already exist). Your RStudio executable will be in
your-chosen-directory/bin/rstudio.exe
Then run CRAN-R installation, ignore the warning that you don’t have administrative privileges and go forward until installation will complete. Run RStudio, from the menu
Tools->Global Options
locate where your R installation is located.
If you performing an update (more recent version of R), copy all files from the library subfolder of the old R installation into new, but this time DON’T OVERWRITE! This operation vill preserves the packages you have installed in the previous version of R. After copying update all your packages from the RStudio window (Packages->Update). When the packages update process will end check which packages failed to update (You will see warning messages near them in the RStudio console). Remove these packages (write down names of failed packages and delete corresponding folders from library subfolder). For this, you will need to exit from RStudio. After deletion launch RStudio again and execute the packages install command in the RStudio console:
install.packages(c("package1", "package2", "package3"))
Congratulations, You are ready to go!

Resources