Hello,
I experience the attached error of “GLIBC_2.29 not found”
when a module is called in my code. How can the GLIBC version be programmatically updated upon building the Binder?
Thank you
Hello,
I experience the attached error of “GLIBC_2.29 not found”
Thank you
Unfortunately it looks like phreeqpy 0.5.1 on PyPI only has a binary wheel, and contains some compiled libraries which contradicts the naming- a none-any.whl
wheel package should be pure python and run on any machine. You can see this by downloading and unzipping the whl
package.
It might be worth contacting the authors to let them know? You could also try compiling the python module yourself.
I am the author of PhreeqPy. It is a platform-independent package that uses ctypes
to access an existing DLL or *.so
. For convenience, I also include the DLL for Windows, the *.dylib
for MacOS as well as the *.so
. Instructions, how to create the *.so
are in the documentation. I don’t want to build different packages for three operation systems and 10 Python versions, which it currently supports.
I think then given what @pya says, @freiburgermsu you could move the installation of the library and package to a postBuild maybe?
Something like this for the postBuild file:
#!/bin/bash
wget https://water.usgs.gov/water-resources/software/PHREEQC/iphreeqc-3.7.3-15968.tar.gz
tar -xzvf iphreeqc-3.7.3-15968.tar.gz
cd iphreeqc-3.7.3-15968
./configure
make
make check
make install
phreeqc = phreeqpy.iphreeqc.phreeqc_dll.IPhreeqc('/home/jovyan/iphreeqc-3.7.3-15968/libiphreeqc.so')
pip install -U phreeqpy
I’m unsure of the phreeqc =
line because I’m not 100% sure where ibiphreeqc.so
gets made. I wonder if it should be:
phreeqc = phreeqpy.iphreeqc.phreeqc_dll.IPhreeqc('/home/jovyan/iphreeqc-3.7.3-15968/lib/libiphreeqc.so')
If that isn’t going to work, then you may need to resort to a Dockerfile to install this so it works via MyBinder.
It appears phreeqpy
is already available on conda-forge and is built, and tested, for each python/platform combination, along with all of its dependencies.
However, requiring the user to find a specific dll at runtime sounds… hard. The conda-forge recipe could be updated to make that path Just Work, as it excels at making stuff portable.
Anyhow, without more info, it looks like the “root cause” of the import is rosspy
… which isn’t yet on conda-forge
, nor are a number of its first-, second- and nth-level dependencies… but we can do pretty well with an environment.yml
…
channels:
- conda-forge
- nodefaults
dependencies:
- pip:
- rosspy
# first-order deps of rosspy
- matplotlib-base
- pandas
- phreeqpy
- scipy
# second-order deps of rosspy
- mpmath
- sortedcontainers
- quantities
- pulp
- pyodesys
- sympy
# baseline
- pip
- python >=3.7
- wheel
These leaves the following wheels it had to build at install time:
rosspy chempy chemw pubchempy pyneqsys chemicals fluids
It’s plausible all of those could also be built for conda-forge.
Here’s a gist:
Hello @fomightez,
Thank you for the detailed suggestion. The folder to which the PHREEQpy
will be built is apparently beyond the permissions of a postBuild " e[91m/usr/bin/install: cannot create regular file '/usr/local/lib/libiphreeqc-3.7.3.so'e[0me[91m: Permission denied
" from this output
make check-TESTS
make[2]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968/tests'
make[3]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968/tests'
PASS: test_c
PASS: test_cxx
============================================================================
Testsuite summary for IPhreeqc 3.7.3-15968
============================================================================
# TOTAL: 2
# PASS: 2
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
make[3]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968/tests'
make[2]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968/tests'
make[1]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968/tests'
Making check in examples
make[1]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968/examples'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968/examples'
Making check in doc
make[1]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968/doc'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968/doc'
Making check in database
make[1]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968/database'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968/database'
Making check in gtest
make[1]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968/gtest'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968/gtest'
make[1]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968'
make[1]: Nothing to be done for 'check-am'.
make[1]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968'
Making install in src
make[1]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968/src'
make[2]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968/src'
/bin/mkdir -p '/usr/local/lib'
/bin/bash ../libtool --mode=install /usr/bin/install -c libiphreeqc.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libiphreeqc-3.7.3.so /usr/local/lib/libiphreeqc-3.7.3.so
e[91m/usr/bin/install: cannot create regular file '/usr/local/lib/libiphreeqc-3.7.3.so'e[0me[91m: Permission denied
e[0me[91mmake[2]: *** [install-libLTLIBRARIES] Error 1
e[0mMakefile:636: recipe for target 'install-libLTLIBRARIES' failed
make[2]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968/src'
Makefile:1169: recipe for target 'install-am' failed
e[91mmake[1]: *** [install-am] Error 2
e[0mmake[1]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968/src'
Makefile:401: recipe for target 'install-recursive' failed
e[91mmake: *** [install-recursive] Error 1
e[0me[91m./binder/postBuild: line 9: syntax error near unexpected token `('
e[0me[91m./binder/postBuild: line 9: `phreeqc = phreeqpy.iphreeqc.phreeqc_dll.IPhreeqc('/home/jovyan/iphreeqc-3.7.3-15968/libiphreeqc.so')'
e[0mRemoving intermediate container 710e1949a0f8
The command '/bin/sh -c ./binder/postBuild' returned a non-zero code: 2Built image, launching...
Failed to connect to event stream
Can the permissions be amended by changing a setting, or is this approach fundamentally incompatible with MyBuilder?
Yeah, one of:
sudo make install
(probably expected)./configure
, make
, or make install
will accept a PREFIX
argument, which could be pointed at, e.g. /home/jovyan/iphreeqc
(more portable)While one of these might make everything start working… it may well just reveal the next thing that isn’t happening exactly the same way as expected.
But… once we’ve figured out all the bobbins over forum posts, slowly, spending lots of your time and mybinder credits running gcc
… we’ll have done enough work to have a conda-forge
recipe for iphreeqc
!
To that end, i did start some issue/PRs to start looking into some of these issues:
Note that the conda version is 0.4.0, whereas the pip version is 0.5.1.
The sudo
command was not recognized
make[1]: Nothing to be done for 'check-am'.
make[1]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968'
e[91m./binder/postBuild: line 8: sudo: command not found
e[0me[91m./binder/postBuild: line 9: syntax error near unexpected token `('
./binder/postBuild: line 9: `phreeqc = phreeqpy.iphreeqc.phreeqc_dll.IPhreeqc('/home/jovyan/iphreeqc-3.7.3-15968/libiphreeqc.so')'
e[0mRemoving intermediate container 1905a83c514d
The command '/bin/sh -c ./binder/postBuild' returned a non-zero code: 2
but the --prefix=/home/jovyan/iphreeqc
argument allowed make install
to complete. Thank you for the suggestions.
The process now throws an error on the last line in the postBuild
file ( phreeqc = phreeqpy.iphreeqc.phreeqc_dll.IPhreeqc('/home/jovyan/iphreeqc/iphreeqc-3.7.3-15968/libiphreeqc.so')
)
Making install in gtest
make[1]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968/gtest'
make[2]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968/gtest'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968/gtest'
make[1]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968/gtest'
make[1]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968'
make[2]: Entering directory '/home/jovyan/iphreeqc-3.7.3-15968'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968'
make[1]: Leaving directory '/home/jovyan/iphreeqc-3.7.3-15968'
e[91m./binder/postBuild: line 9: syntax error near unexpected token `('
e[0me[91m./binder/postBuild: line 9: `phreeqc = phreeqpy.iphreeqc.phreeqc_dll.IPhreeqc('/home/jovyan/iphreeqc-3.7.3-15968/libiphreeqc.so')'
e[0mRemoving intermediate container 45672941d218
The command '/bin/sh -c ./binder/postBuild' returned a non-zero code: 2Built image, launching...
Failed to connect to event stream
Do you have suggestions for how this can be resolved?
The build near completion; thank you so much for your support
Hello @pya ,
I encounter phreeqc: command not found
after executing your Linux sequence. How can the phreeqc
command be instantiated?
BTW: The aforementioned error was resolved by escaping (
& )
in phreeqc = phreeqpy.iphreeqc.phreeqc_dll.IPhreeqc('/full/path/to/libiphreeqc.so')
.
Thank you
Hello!
I have not resolved the bug. The error seems to originate from an outdated package in the Ubuntu 18 that is used by Google colab. The best suggestion that I have receive is to create a docker image of my operational package that can be used by incompatible Ubuntu OS’s. The permanent resolution, however, seems to be updating the troublesome package source.
Send me a note with any of your discoveries.
Andrew
I’m sorry but it’s hard to follow what you are specifically seeking in your latest post.
There isn’t even a launch binder
button on the repo or a link to start a session in this thread that I can see. Did I miss it? Let’s say, I figured that out and we continue on…
Not following what you mean by this at all? What bug? What about ‘Google colab’? This is under a ‘Binder help-wanted’ topic and so I’m not sure why ‘Google Colab’ is being mentioned?
The last thing posted in this thread referenced the following directed to @pya, who is the author of PhreeqPy:
Is that the ‘bug’ you are referencing in your current post here?
If so, I’m not sure why you are asking @pya, who is the author of PhreeqPy. PhreeqPy works fine in sessions launched from your current repo according to running the PhreeqPy ‘simple’ example.
Launch the session by clicking here (noting that this corresponds to this commit for possible future reference), and then in the root directory make a script file where you place the contents from the code block at the simple PhreeqPy example. Edit the first two code lines under def initialize()
section to match the current situation, taking into account what it says here about the 'phreeqc =
’ line.
Those two lines are currently:
phreeqc = phreeqc_mod.IPhreeqc()
phreeqc.load_database(r"phreeqc.dat")
Based on the configuration in the resulting session, I edited those two lines to be the following and saved the script file:
phreeqc = phreeqc_mod.IPhreeqc('/home/jovyan/iphreeqc-3.7.3-15968/src/.libs/libiphreeqc-3.7.3.so')
phreeqc.load_database(r"/home/jovyan/iphreeqc-3.7.3-15968/database/phreeqc.dat")
Running the script file in the terminal you should see something like:
jovyan@jupyter-freiburgermsu-2drosspy-2d2u2smk3h:~$ python example_PhreeqPy.py
Dimensions
==========
number of cells: 40
number of shifts 120
run time: 0.5545081389136612
Finished simulation
So that says that PhreeqPy
works in the launched sessions.
Note this is even in Ubuntu 18.04, revealed by running cat /etc/lsb-release
in a terminal in a launched session presently. And so I’m not sure why you say, “The error seems to originate from an outdated package in the Ubuntu 18…”
Trying to run brine_concentrations.ipynb
example in examples/brine/Ahmed_et_al/
, I see that the second cell gives the error ModuleNotFoundError: No module named 'win32com'
. That’s because you have operating_system = 'windows'
on line 56 of ./rosspy/ro.py
. Changing that part of line 56 to read operating_system = 'unix'
allows that second code cell to run.
Then the third code cell fails at the line 736 phreeqc = self.phreeqc_mod.IPhreeqc()
, and so change line 736 of ./rosspy/ro.py
like we did above for the PhreeqPy simple example script:
phreeqc = phreeqc_mod.IPhreeqc('/home/jovyan/iphreeqc-3.7.3-15968/src/.libs/libiphreeqc-3.7.3.so')
Because you are using phreeqc_mod
there, you need that replacement to actually be the following or you get NameError: name 'phreeqc_mod' is not defined
(I’m not sure why that is since I thought you handled it up on line 73 of ro.py
):
import phreeqpy.iphreeqc.phreeqc_dll as phreeqc_mod
phreeqc = phreeqc_mod.IPhreeqc('/home/jovyan/iphreeqc-3.7.3-15968/src/.libs/libiphreeqc-3.7.3.so')
After that, things seem to work. And hence not following what your issues are?
Hello!
I apologize for the confusion; I replied to the attached message
and somehow my response sent to the whole forum instead of just to the inquirer. I nevertheless greatly appreciate your analysis of the situation.
I removed the binder
logo in my repository after I was unable to debug it. A few of my collaborators also tried to run the code in Google Colab but received the original error message of this thread, which I thought may have a common root cause as the error with Binder. Your investigation, however, suggests a clear path forward, so I will try developing the Binder again.
Thank you
Andrew
That explains a large percentage of things.
So you know, the postBuild
(or start
) configuration file could be adapted to do those steps I mentioned in the last section of my post so that you can leave your repo “as-is” without making a separate branch (or repo) with the settings coded you need for running your code in session via MyBinder. Those changes would only happen in the resulting image or session depending if you adapt postBuild
or start
. Because you hardcoded in some things, like assuming it was on Windows, I suspect your development matches that better and you would prefer to leave it that way. Letting the configuration files handle that adjustment only in the MyBinder-associated launches/sessions is an option that could save you work. Let me know if need a hand.