Closed observingClouds closed 2 years ago
Could you add the return from both pip install commands?
Here you go:
% pip install git+https://github.com/observingClouds/xbitinfo.git
Collecting git+https://github.com/observingClouds/xbitinfo.git
Cloning https://github.com/observingClouds/xbitinfo.git to /private/var/folders/fj/g0x4n_f15tb6zfwjhzc8gvzr0000gn/T/pip-req-build-tbn7nkvw
Running command git clone --filter=blob:none --quiet https://github.com/observingClouds/xbitinfo.git /private/var/folders/fj/g0x4n_f15tb6zfwjhzc8gvzr0000gn/T/pip-req-build-tbn7nkvw
Resolved https://github.com/observingClouds/xbitinfo.git to commit 4d5563e3416d61b26589abcdd32a08dd72fd361b
Preparing metadata (setup.py) ... done
Requirement already satisfied: xarray in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xbitinfo==0.0.2) (2022.3.0)
Requirement already satisfied: julia in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xbitinfo==0.0.2) (0.5.7)
Requirement already satisfied: tqdm in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xbitinfo==0.0.2) (4.64.0)
Requirement already satisfied: numcodecs>=0.10.0 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xbitinfo==0.0.2) (0.10.1.dev1)
Requirement already satisfied: typing-extensions>=3.7.4 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from numcodecs>=0.10.0->xbitinfo==0.0.2) (4.3.0)
Requirement already satisfied: numpy>=1.7 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from numcodecs>=0.10.0->xbitinfo==0.0.2) (1.23.0)
Requirement already satisfied: pandas>=1.1 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xarray->xbitinfo==0.0.2) (1.4.3)
Requirement already satisfied: packaging>=20.0 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xarray->xbitinfo==0.0.2) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from packaging>=20.0->xarray->xbitinfo==0.0.2) (3.0.9)
Requirement already satisfied: python-dateutil>=2.8.1 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from pandas>=1.1->xarray->xbitinfo==0.0.2) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from pandas>=1.1->xarray->xbitinfo==0.0.2) (2022.1)
Requirement already satisfied: six>=1.5 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from python-dateutil>=2.8.1->pandas>=1.1->xarray->xbitinfo==0.0.2) (1.16.0)
Building wheels for collected packages: xbitinfo
Building wheel for xbitinfo (setup.py) ... done
Created wheel for xbitinfo: filename=xbitinfo-0.0.2-py2.py3-none-any.whl size=20693 sha256=a17f07f5cc1f567d8898bcb014e450c4bda9d452a2e2224d14c35fa07c7b5c3b
Stored in directory: /private/var/folders/fj/g0x4n_f15tb6zfwjhzc8gvzr0000gn/T/pip-ephem-wheel-cache-hy85njh8/wheels/7f/73/1d/68290b3559f4c7c26915da78a7bc69f3258dce9a13643de2bd
Successfully built xbitinfo
Installing collected packages: xbitinfo
Successfully installed xbitinfo-0.0.2
and
% pip install xbitinfo
Collecting xbitinfo
Downloading xbitinfo-0.0.2-py2.py3-none-any.whl (20 kB)
Requirement already satisfied: numcodecs>=0.10.0 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xbitinfo) (0.10.1.dev1)
Requirement already satisfied: julia in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xbitinfo) (0.5.7)
Requirement already satisfied: tqdm in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xbitinfo) (4.64.0)
Requirement already satisfied: xarray in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xbitinfo) (2022.3.0)
Requirement already satisfied: typing-extensions>=3.7.4 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from numcodecs>=0.10.0->xbitinfo) (4.3.0)
Requirement already satisfied: numpy>=1.7 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from numcodecs>=0.10.0->xbitinfo) (1.23.0)
Requirement already satisfied: pandas>=1.1 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xarray->xbitinfo) (1.4.3)
Requirement already satisfied: packaging>=20.0 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from xarray->xbitinfo) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from packaging>=20.0->xarray->xbitinfo) (3.0.9)
Requirement already satisfied: python-dateutil>=2.8.1 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from pandas>=1.1->xarray->xbitinfo) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from pandas>=1.1->xarray->xbitinfo) (2022.1)
Requirement already satisfied: six>=1.5 in /Users/haukeschulz/mambaforge/envs/114/lib/python3.9/site-packages (from python-dateutil>=2.8.1->pandas>=1.1->xarray->xbitinfo) (1.16.0)
Installing collected packages: xbitinfo
Successfully installed xbitinfo-0.0.2
Building wheels for collected packages: xbitinfo is missing somehow
Well, I think the wheels are those that we create beforehand and upload to pypi. I think we need to check the wheel building process again. The issue might be that PostInstallCommand
https://github.com/observingClouds/xbitinfo/blob/4d5563e3416d61b26589abcdd32a08dd72fd361b/setup.py#L22-L27 is not executed when installing from Pypi.
@ocefpaf do you have an idea how to fix this?
I'm actually looking into the best practices for shipping/installing julia packages when wrapping them with Python. So far, all I can say, is that calling os.system
is a no-no :-/
In conda-forge we can easily ship a julia interpreter and make that a dependency. In PyPI I could not find any guidance yet.
PS: It would be nice if the underlying code was re-written in a more "wrapping friendly" language, like C/C++/Rust. Julia is easy to wrap but hard to ship b/c of the numerous patches they apply to llvm.
So a conda release could maybe work? Let’s try
I was actually thinking the same today! It's the best option we have currently.
Also to have it just installable in an easier way
Just want to xref. this discussion here: https://github.com/conda-forge/pysr-feedstock/issues/38 Things are in flux but we can use that solution to make this package available on conda-forge at the moment.
Thanks to @rsignell-usgs we make great progress on the conda package: https://github.com/conda-forge/staged-recipes/pull/20116
And @ocefpaf said he would help us with the Julia issues! Yay! Probably some time next week...
Just a note here that you can now install xbitinfo on Linux using conda-forge:
conda install -c conda-forge xbitinfo
We installed it on the ESIP Qhub JupyterHub Deployment (on Kubernetes w/ Dask Gateway) and it's working great!
The conda-forge recipe uses a patch -- @observingClouds would you be interested in making the changes in the repo here so we don't need that?
Did I get that right @ocefpaf ?
Did I get that right @ocefpaf ?
Yep. The patch removed the post install command, which can be troublesome, and uses a install function that runs at import time to install and activate the Julia environment for xbitinfo. It is slow the first time you import it but it should skip the install steps the second time and perform only the activation.
In theory that works with both conda and pip. Should I send a PR to test that here?
Thank you so much guys! This is amazing! I'm happy to drop the pre/post-install commands if the suggested method works for both pip and conda.
@ocefpaf please do a PR, you guys should get the credit for this!
Closing as this should be fixed by #132
I pip install xbitinfo
and julia
isnt installed:
from pypi
(/work/mh0727/m300524/conda-envs/test2) m300524@levante1:~$ pip install xbitinfo
Collecting xbitinfo
Using cached xbitinfo-0.0.2-py2.py3-none-any.whl (20 kB)
Collecting numcodecs>=0.10.0
Using cached numcodecs-0.10.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.7 MB)
Requirement already satisfied: tqdm in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from xbitinfo) (4.62.3)
Collecting xarray
Downloading xarray-2022.6.0-py3-none-any.whl (927 kB)
|████████████████████████████████| 927 kB 3.6 MB/s
Collecting julia
Using cached julia-0.5.7-py2.py3-none-any.whl (67 kB)
Collecting typing-extensions>=3.7.4
Downloading typing_extensions-4.3.0-py3-none-any.whl (25 kB)
Collecting numpy>=1.7
Downloading numpy-1.23.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
|████████████████████████████████| 17.1 MB 110.1 MB/s
Collecting entrypoints
Downloading entrypoints-0.4-py3-none-any.whl (5.3 kB)
Collecting pandas>=1.2
Downloading pandas-1.4.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.7 MB)
|████████████████████████████████| 11.7 MB 119.8 MB/s
Collecting packaging>=20.0
Downloading packaging-21.3-py3-none-any.whl (40 kB)
|████████████████████████████████| 40 kB 6.1 MB/s
Collecting pyparsing!=3.0.5,>=2.0.2
Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
|████████████████████████████████| 98 kB 7.2 MB/s
Collecting pytz>=2020.1
Downloading pytz-2022.2.1-py2.py3-none-any.whl (500 kB)
|████████████████████████████████| 500 kB 127.7 MB/s
Collecting python-dateutil>=2.8.1
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
|████████████████████████████████| 247 kB 119.3 MB/s
Requirement already satisfied: six>=1.5 in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from python-dateutil>=2.8.1->pandas>=1.2->xarray->xbitinfo) (1.16.0)
Installing collected packages: pytz, python-dateutil, pyparsing, numpy, typing-extensions, pandas, packaging, entrypoints, xarray, numcodecs, julia, xbitinfo
python
import xbitinfo
Successfully installed entrypoints-0.4 julia-0.5.7 numcodecs-0.10.2 numpy-1.23.2 packaging-21.3 pandas-1.4.4 pyparsing-3.0.9 python-dateutil-2.8.2 pytz-2022.2.1 typing-extensions-4.3.0 xarray-2022.6.0 xbitinfo-0.0.2
(/work/mh0727/m300524/conda-envs/test2) m300524@levante1:~$ python
import xbitinfo
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/work/mh0727/m300524/mambaforge/lib/python3.9/site-packages/xbitinfo/init.py", line 4, in <module>
from .bitround import jl_bitround, xr_bitround
File "/work/mh0727/m300524/mambaforge/lib/python3.9/site-packages/xbitinfo/bitround.py", line 4, in <module>
from .xbitinfo import jl_bitround, get_keepbits
File "/work/mh0727/m300524/mambaforge/lib/python3.9/site-packages/xbitinfo/xbitinfo.py", line 12, in <module>
jl = Julia(compiled_modules=False, debug=False)
File "/work/mh0727/m300524/mambaforge/lib/python3.9/site-packages/julia/core.py", line 468, in _init
jlinfo = JuliaInfo.load(runtime)
File "/work/mh0727/m300524/mambaforge/lib/python3.9/site-packages/julia/juliainfo.py", line 68, in load
proc = subprocess.Popen(
File "/work/mh0727/m300524/mambaforge/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/work/mh0727/m300524/mambaforge/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'julia'
From main
:
(/work/mh0727/m300524/conda-envs/test2) m300524@levante6:~$ pip install -U git+https://github.com/observingClouds/xbitinfo.git
Collecting git+https://github.com/observingClouds/xbitinfo.git
Cloning https://github.com/observingClouds/xbitinfo.git to /tmp/pip-req-build-rg6iarcn
Running command git clone --filter=blob:none -q https://github.com/observingClouds/xbitinfo.git /tmp/pip-req-build-rg6iarcn
Resolved https://github.com/observingClouds/xbitinfo.git to commit e92d4e764cc21c962fee7c559966018b589ba5d5
Preparing metadata (setup.py) ... done
Requirement already satisfied: xarray in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from xbitinfo==0.0.3.dev23+ge92d4e7) (2022.6.0)
Requirement already satisfied: julia in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from xbitinfo==0.0.3.dev23+ge92d4e7) (0.5.7)
Requirement already satisfied: tqdm in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from xbitinfo==0.0.3.dev23+ge92d4e7) (4.62.3)
Requirement already satisfied: numcodecs>=0.10.0 in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from xbitinfo==0.0.3.dev23+ge92d4e7) (0.10.2)
Requirement already satisfied: numpy>=1.7 in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from numcodecs>=0.10.0->xbitinfo==0.0.3.dev23+ge92d4e7) (1.23.2)
Requirement already satisfied: typing-extensions>=3.7.4 in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from numcodecs>=0.10.0->xbitinfo==0.0.3.dev23+ge92d4e7) (4.3.0)
Requirement already satisfied: entrypoints in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from numcodecs>=0.10.0->xbitinfo==0.0.3.dev23+ge92d4e7) (0.4)
Requirement already satisfied: pandas>=1.2 in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from xarray->xbitinfo==0.0.3.dev23+ge92d4e7) (1.4.4)
Requirement already satisfied: packaging>=20.0 in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from xarray->xbitinfo==0.0.3.dev23+ge92d4e7) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from packaging>=20.0->xarray->xbitinfo==0.0.3.dev23+ge92d4e7) (3.0.9)
Requirement already satisfied: pytz>=2020.1 in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from pandas>=1.2->xarray->xbitinfo==0.0.3.dev23+ge92d4e7) (2022.2.1)
Requirement already satisfied: python-dateutil>=2.8.1 in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from pandas>=1.2->xarray->xbitinfo==0.0.3.dev23+ge92d4e7) (2.8.2)
Requirement already satisfied: six>=1.5 in /work/mh0727/m300524/mambaforge/lib/python3.9/site-packages (from python-dateutil>=2.8.1->pandas>=1.2->xarray->xbitinfo==0.0.3.dev23+ge92d4e7) (1.16.0)
Building wheels for collected packages: xbitinfo
Building wheel for xbitinfo (setup.py) ... done
Created wheel for xbitinfo: filename=xbitinfo-0.0.3.dev23+ge92d4e7-py2.py3-none-any.whl size=22616 sha256=7444a8d1e4a52b2d3c33b23c0428ade01c4bda711b73e49b2f73aef76ee93ba6
Stored in directory: /tmp/pip-ephem-wheel-cache-xi9g51gw/wheels/7f/73/1d/68290b3559f4c7c26915da78a7bc69f3258dce9a13643de2bd
Successfully built xbitinfo
Installing collected packages: xbitinfo
Attempting uninstall: xbitinfo
Found existing installation: xbitinfo 0.0.2
Uninstalling xbitinfo-0.0.2:
Successfully uninstalled xbitinfo-0.0.2
Successfully installed xbitinfo-0.0.3.dev23+ge92d4e7
(/work/mh0727/m300524/conda-envs/test2) m300524@levante6:~$ python
Python 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:20:46)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xbitinfo
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/work/mh0727/m300524/mambaforge/lib/python3.9/site-packages/xbitinfo/__init__.py", line 8, in <module>
from .bitround import jl_bitround, xr_bitround
File "/work/mh0727/m300524/mambaforge/lib/python3.9/site-packages/xbitinfo/bitround.py", line 4, in <module>
from .xbitinfo import _jl_bitround, get_keepbits
File "/work/mh0727/m300524/mambaforge/lib/python3.9/site-packages/xbitinfo/xbitinfo.py", line 15, in <module>
already_ran = install(quiet=True)
File "/work/mh0727/m300524/mambaforge/lib/python3.9/site-packages/xbitinfo/julia_helpers.py", line 22, in install
julia.install(quiet=quiet)
File "/work/mh0727/m300524/mambaforge/lib/python3.9/site-packages/julia/tools.py", line 78, in install
raise JuliaNotFound(julia, kwargname="julia")
julia.core.JuliaNotFound: Julia executable `julia` cannot be found.
If you have installed Julia, make sure Julia executable is in the
system PATH. Alternatively, specify file path to the Julia executable
using julia
keyword argument.
If you have not installed Julia, download Julia from https://julialang.org/downloads/ and install it.
That is expected but we need a better error message to tell users to have a julia executable int he path. The useful bit of information (no pun intended) is lost in the traceback.
I'm not sure installing julia automatically is recommend. However, if there is a safe way to do that in all platforms we could try it.
pyjulia in the requirements is not enough. This was this previous solution
pyjulia in the requirements is not enough. This was this previous solution
Interesting. I had no idea pyjulia would install julia when asked to do it and I may have disabled it then. I'll investigate this. However, my packager bias tells me that installing julia automatically is more trouble then it is worth. Again, I don't have experience with that kind of automatic installation, maybe it is fine nowadays and I'm outdated.
Note that their docs seems to tell users to handle the julia installation manually. See https://pyjulia.readthedocs.io/en/latest/installation.html#step-1-install-julia
PS: I tried and I'm not able to make it work with just the install call:
❯ pip install julia
Collecting julia
Downloading julia-0.5.7-py2.py3-none-any.whl (67 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 67.6/67.6 kB 1.9 MB/s eta 0:00:00
Installing collected packages: julia
Successfully installed julia-0.5.7
(TMP)
~ via 🐍 v3.10.6 via 🅒 TMP
❯ python
Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:36:39) [GCC 10.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from julia import install
>>> install()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/filipe/micromamba/envs/TMP/lib/python3.10/site-packages/julia/tools.py", line 78, in install
raise JuliaNotFound(julia, kwargname="julia")
julia.core.JuliaNotFound: Julia executable `julia` cannot be found.
If you have installed Julia, make sure Julia executable is in the
system PATH. Alternatively, specify file path to the Julia executable
using `julia` keyword argument.
If you have not installed Julia, download Julia from
https://julialang.org/downloads/ and install it.
I'm probably missing some detail here. I'll check the old code and get back when I find it.
I think we should just mention in the documentation/readme that the installation via conda is preferred and that one need to install Julia manually when using pip.
ok. lets close then
Description
I was trying to install xbitinfo via pip but got the following error message when importing it via
import xbitinfo
:Might be related to https://stackoverflow.com/questions/15853058/run-custom-task-when-call-pip-install
What I did
returns the error above.
works.