Can not connect python to h2o instance (version mismatch) - python

I have just run an upgrade on the h2o package in python, but am only getting a version of 3.10.4.1. However, my recently upgraded h2o application is running 3.10.4.6 - can you please help me rectify this discrepancy? Thanks in advance.

An H2O version mismatch is caused when the H2O Java application and the h2o Python module (or R package) have different version numbers. If you only use the h2o Python module, this will not happen. However, if you launch an H2O cluster from the command line, java -jar h2o.jar, and then connect to it via the h2o Python module, the version numbers can be in disagreement.
If this happens, the best way to resolve is to kill the existing Java process and start the H2O cluster from inside the h2o Python module. Alternatively, you can pip uninstall h2o, visit the H2O Downloads page and install the matching version of the Python package.

This has been resolved. It was a path mixup which I have fixed and now can see the same h2o.version from the cmd and jupyter.

Here is another solution: Best way is to match both the versions.
Try to be on the latest. Few things are tricky while matching the versions. When you are upgrading the one that has lower version, make sure you do h2o.shutdown() to shut the h2o else, the uninstall or install won't happen successfully.
And then go to h2o-ai and follow the steps

Related

I'm receiving a NetworkX related error on Memgraph startup

When I start Memgraph I can't access query modules. Right after the startup, I get ImportError for the NetworkX module. I've checked and I can see that I have NetworkX installed. I've also tried to reinstall Mmegraph but I had no luck. The error is still there.
This is most likely due to the Python version. Memgraph is using the default system Python.
Check the Python version with python --version. If you don't run Python 3, upgrade it. With python3 there shouldn't be such problems.

ImportError while using AWS Lambda in Python (via zappa serverless); Numpy

I have an ImportError issue with my AWS Lambda function
I can run this code locally without ImportError
I use zappa serverless for uploading my code to AWS Lambda--which requires a virtual environment and is an end-to-end solution for creating and updating Lambda functions
I previously had this code working on AWS Lambda
I'm not sure of the change I made (#3) that made this code go from working to ImportError. The log output is as follows.
[ERROR] Runtime.ImportModuleError: Unable to import module 'dailycore': Unable to import required dependencies:
numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.8 from "/var/lang/bin/python3.8"
* The NumPy version is: "1.23.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'
I'm unclear if this is a Numpy issue, a Python issue, or a Zappa issue. Two changes I made that may have had an impact:
I separated out some of my personal code, uploaded it to github, and installed it as packages within the virtual environment using pip
I uninstalled Python from my machine and reinstalled it--as I had two versions causing conflict. Upon my reinstallation (Python 3.8), I changed the installation directory from its default.
The code runs from VS Code locally and wholly contained from within the virtual environment (i.e. I don't have any packages installed via pip on my machine outside of virtual environments at this point). The suggestions above may or may apply to this error. I've tried adding a system PATH variable to my Python 3.8 directory. I've tried downgrading numpy to 1.23.0. I've tried uninstalling all dependencies within the virtual environment and reinstalling them.
UPDATE: I found this link and am looking into these comments: https://github.com/Miserlou/Zappa/issues/1222
UPDATE2: I deleted the virtual environment and re-created per a suggestion at the link above. This did not work.
UPDATE3: I think my issue relates to the private package dependencies I installed via pip from my personal github repos (#2-2). This link may be related. Something about dependencies not being at the top level. I am unsure how to fix this issue and/or repackage my private repo or install correctly. Any clarification is appreciated.
UPDATE4: I've isolated my issue to the private package dependencies and how they get called. A the solution may be related to Lambda Layers, tutorial here. Looking into this.
The ImportModuleError is related to this python package: alpha_vantage and not either of my initial theories. I am unsure as to why, though. It seems like it has something to do with Alpha Vantage's setup.py file; although I could be mistaken.
I have removed the reference to Alpha Vantage for now, but if anyone knows why installing this package would throw a numpy error, please elaborate. I think the only reference to numpy would be through the pandas package--which is only an optional install (i.e. extras_requires in setup.py)

Can't seem to get the latest version of H2O to work

I'm learning how to use h2o but I can't seem to get the latest version to work in Jupyter Notebooks. I can manage to get it running with a very old version though (about 1 year and a few months old). I keep getting stuck when I try to initialise it
import h2o
h2o.init()
I found there were several versions of h2o that I could download online. Here's what I tried:
I had first downloaded h2o from here (https://anaconda.org/anaconda/h2o) but it could not find the module when I tried importing it over in Jupyter (I installed the package and opened up Jupyter with the same environment [Python 3.6]). This was fixed when I downloaded the additional h2o-py package (https://anaconda.org/anaconda/h2o-py). I could run H2O with these two packages installed, its just that its a pretty old version (3.18.0.2).
Deleting the h2o and leaving only the h2o-py gives me this error:
H2OStartupError: Cannot start local server: h2o.jar not found.
I also tried getting the latest version from the h2o website (http://docs.h2o.ai/h2o/latest-stable/h2o-docs/downloading.html) - I am assuming this is the one. I followed the downloading instructions for both pip and conda but neither worked.
I kept getting the H2O Connection Error and CalledProcess Error when I tried to initialise h2o.
H2OConnectionError: Could not establish link to the H2O cloud http://localhost:54321 after 5 retries
CalledProcessError: Command '['/usr/bin/java', '-version']' returned non-zero exit status 2.
I tried this in combination with h2o-py, h2o and h2o together (latest one from the website), and just the h2o package alone but nothing is working. So far, the only thing that I got working was the h2o in combination with h2o-py, both of which are the older versions of h2o.
Is there something that I'm missing?
=======================================================================
TL;DR
With packages:
1) h2o and h2o-py - works, but is an older version
2) h2o only - cannot find module when importing
3) h2o-py only - H2OStartupError: h2o.jar not found
4) h2o (latest version) and others (h2o (old version) or h2o-py)- Connection Error when initialising
5) all three packages together - Cannot find module when importing
The "java -version" command not working is definitely something you need to resolve.
CalledProcessError: Command '['/usr/bin/java', '-version']' returned non-zero exit status 2.
H2O-3 uses Java underneath the hood to do it's work. I recommend installing Java 8 on your host.
Start debugging this by running java -version by hand in a terminal and see if that helps pinpoint the problem. Chances are you just need to install java itself.
The officially recommended way to install the conda package is
conda install -c h2oai h2o
I would start with a fresh environment that doesn't contain the other h2o packages you tried. Note that h2o-py is not an official h2o package and it's not recommended to ever use it.

0x80070643 error while installing Python 3.6

I'm actually using Python for an audio steganography project but I have some troubles.
I searched this error code on the forum, but I found things about SQL installations and not Python.
I'm trying to re-install Python 3.6.5 after an uninstall, because of a bug with pip.
I installed Python 2.7, Python 3.6.5, Python with VS 2017, before uninstall it because it wasn't working.
However, when I'm runing the installer as an administrator, hit "customize installation", tick everything excpet "balblalblabal (this requires VS 2015 or later)", and click on "install", it tells me that :
.
I realy need Python to work and I'm now stuck ...
If anybody here could help me, it would be nice !
Thanks all,
maleik.
PS : I have the log for you :*
The log link
I found this in the log file which you have attached. Try cleaning the registry with CC cleaner and give it a try. If it still doesn't work, try installing python with web installer Python Web Installed 3.6.5.
[3DA0:2968][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to install MSI package.
[3DA0:2968][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to execute MSI package.
[2610:03A4][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to configure per-machine MSI package.
[2610:03A4][2018-12-05T20:46:18]i319: Applied execute package: core_AllUsers, result: 0x80070643, restart: None
[2610:03A4][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to execute MSI package
I installed python from Microsoft store after facing this problem and it magically got installed without any error as it may have directly been installed. I don't know but try if it eorks for you too.
You need to run the installation as a local administrator.
I had the same problem installing Python version 3.9 for the first time on my Windows 10, as this same problem happens to many users trying to install Python, the best solution I accidentally, just like #MANAN AGGARWAL discovered trying to check if I already had a version of Python installed on my computer by the DOS Command Prompt, was:
Open the DOS Command Prompt (cmd) and dictate "python": if a screen shows you a version, it's clearly not the first time you've installed Python, so if you want to upgrade you should try: https: / /www.delftstack.com/en/howto/python/how-to-update-python/ But if you've never installed any version of Python, the solution lies in updating your operating system to the latest version through Windows Update, and open the command prompt and type Python, or go directly to the Microsoft Store and search for Python followed by its latest version. It works without error.
** If by chance it does not automatically install on your PC after downloading, click "install on my devices" and select your computer name.
Why can't I install Python directly from the website file? Please note that when trying to install any software/applications from outside Microsoft's trusted locations, there are high chances of user settings interfering with the installation. When coming, for example, from the Microsoft Store, a chance of success is much greater, even without having problems related to User Permission Settings.
Another important thing to point out here is that installing a lot of software from outside Microsoft's trusted platforms can cause you to change some user permissions which can have positive effects with some software and negative effects with others, even with security your own system if you don't know what you're doing.
it's simple , Try Lower Version Like 'Python 3.6' but Download web install.
install it , then install last python version.
your python will update.
I've faced same/similar problem with installing Python 3.9.12 in a clean Windows 8.1 64-bit (VirtualBoxed test environment).
I thought the issue could have been fixed in a newer version of Python, but the freshest 3.10.10 fails with same issue.
The original log isn't available any longer, but luckily it is quoted in another answer, and the following line reveals the real problem:
Applied execute package: core_AllUsers, result: 0x80070643, restart: None
My log looks the same, and if you scroll the log up, you'll discover that core_AllUsers is a UCRT MSI-installer, which is downloaded from Python site (for 3.10.10 64-bit the link may look like https://www.python.org/ftp/python/3.10.10/amd64/ucrt.msi).
If you download it manually (Python installer is smart enough to do a cleanup even if it fails, so you won't find this MSI in a local cache) and run, it will probably crash. And if it is your case, I have a simple solution - just install update KB2999226 (Update for Universal C Runtime) for your OS, which you can download from Microsoft.
I also faced the similar issue. What the trick worked for me is I installed it for the individual user (as earlier installation was for the all users).
So earlier if one has installed it for the all users then install it for the specific user and vice versa.
I know this is not the resolution of the error faced. However, this approach will install Python which is the main motive to achieve.
I encountered the same issue after installing a fresh Windows 8.1 on my PC.
I solved that by using the Python v3.9 web installation file which you can find here.
However, you can choose any other version that has a web installation file
Note: You need internet connection to use this method.

ImportError: No module named 'resource'

I am using python 3.5 and I am doing Algorithms specialization courses on Coursera. Professor teaching this course posted a program which can help us to know the time and memory associated with running a program. It has import resource command at the top. I tried to run this program along with the programs I have written in python and every time I received ImportError: No module named 'resource'
I used the same code in ubuntu and have no errors at all.
I followed suggestions in stackoverflow answers and I have tried adding PYTHONPATH PYTHONHOME and edited the PATH environment variable.
I have no idea of what else I can do here.
Is there any file that I can download and install it in the Lib or site-packages folder of my python installation ?
resource is a Unix specific package as seen in https://docs.python.org/2/library/resource.html which is why it worked for you in Ubuntu, but raised an error when trying to use it in Windows.
I ran into similar error in window 10. Here is what solved it for me.
Downgrade to the Apache Spark 2.3.2 prebuild version
Install (or downgrade) jdk to version 1.8.0
My installed jdk was 1.9.0, which doesn't seem to be compatiable with spark 2.3.2 or 2.4.0
make sure that when you run java -version in cmd (command prompt), it show java version 8. If you are seeing version 9, you will need to change your system ENV PATH to ensure it points to java version 8.
Check this link to get help on changing the PATH if you have multiple java version installed.
Hope this helps someone, I was stuck on this issue for almost a week before finally finding a solution.

Categories

Resources