-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pip Install Okada Wrapper Issues #15
Comments
Could you try installing from the GitHub repository directly? We made some updates to address deprecations (see that first warning in your log) but they weren't pushed to PyPI yet. I.e., try this: git clone https://github.com/tbenthompson/okada_wrapper.git
pip install ./okada_wrapper/ @tbenthompson I just noticed that the README contains old "manual installation" instruction that refer to Cheers |
Thanks for the quick reply! I tried using git clone and then pip install but I got the following errors: pip install ./okada_wrapper/ × Preparing metadata (pyproject.toml) did not run successfully.
note: This error originates from a subprocess, and is likely not a problem with pip. × Encountered error while generating package metadata. note: This is an issue with the package mentioned above, not pip. Something wrong with the gfortran? |
It seems so - could you upload the log file mentioned in the output? And post your versions for the two necessary compilers: gcc --version
gfortran --version |
Interestingly, the log doesn't exist. There is no such directory on my computer at all. output of gcc --version: Apple clang version 15.0.0 (clang-1500.3.9.4) output of gfortran --version: GNU Fortran (GCC) 11.1.0 |
I saw this thread in my email and figured I should get around to publishing a release. But I ran into this same issue! I'm on a newer gfortran (13.2.0). I need to get back to my job for now, but I'll try to come back to this soon. It looks like this issue is probably related to mesonbuild/meson#12282 and there's a workaround towards the end of the thread. Maybe @tobiscode would understand what to do better? I haven't yet learned my way around Meson. |
Also, the log file mentioned didn't exist for me either. I'm guessing there's a flag we can pass to the build so that it doesn't delete the logs but I haven't found it yet. Or maybe something else is going on there? |
Yeah I think that's what's happening - this could fix it: https://pip.pypa.io/en/latest/cli/pip_install/#cmdoption-no-clean With regards to the actual error, with the version output
I can now see that you're using MacOS. I don't have a Mac myself so I can't test it, but if it's similar to the link @tbenthompson posted, then it could be because of that. In that case, I cannot directly help with debugging/testing myself, although I'm happy to give the detailed logs a close look and suggest changes you can try. |
The installation was smoothly done on my Linux remote server so I will work on that server to save some time. If I have more spare time in the future I will come back to this issue. Thanks anyway for your suggestions!!! |
I experienced a similar issue today when I attempted to install okada_wrapper within a conda environment. The main problem seems to be that "numpy.distutils is deprecated and will be removed for Python >= 3.12," as indicated on this webpage (https://numpy.org/doc/stable/reference/distutils.html#). To resolve this problem, I manually set the Python version to 3.11, which solved the issue.
Here's what my conda environment config file looks like:
I hope this information is helpful. |
@sangchengfang the issue you're reporting is different (as far as I can see) and has already been fixed in #8 and #12 but it hasn't been pushed to PyPI yet (which is still in the works by @tbenthompson). You can use |
Ah! Sorry to forget to do the PyPI release. It fell off my radar. I’ll do it in the next couple days. |
@tobiscode OK, got it. |
Release is done! I did a quick check and it worked for me. Let me know if either of you have issues. |
Thanks @tbenthompson! Just for reference though: I can install it fine but running the test script fails if I run it directly. However, when I first open Python and then call the same import routine, everything works: ~ > python ~/projects/okada_wrapper/test_okada.py
Traceback (most recent call last):
File "/home/tkoehne/projects/okada_wrapper/test_okada.py", line 1, in <module>
from okada_wrapper import dc3d0wrapper, dc3dwrapper
File "/home/tkoehne/projects/okada_wrapper/okada_wrapper/__init__.py", line 4, in <module>
from okada_wrapper.okada_wrapper import dc3d0wrapper, dc3dwrapper
File "/home/tkoehne/projects/okada_wrapper/okada_wrapper/okada_wrapper.py", line 1, in <module>
from .DC3D import dc3d0, dc3d
ModuleNotFoundError: No module named 'okada_wrapper.DC3D'
~ > python
Python 3.11.5 | packaged by conda-forge | (main, Aug 27 2023, 03:34:09) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from okada_wrapper import dc3d0wrapper, dc3dwrapper # this is the first line of test_okada.py
>>> exit() So, I'm assuming it's again something about relative imports that could be fixed either in the source code or the test script. |
Thanks for bringing this up! The error you got is expected because you’re running the script from within the okada_wrapper folder. As a result, you’re importing the local version of okada_wrapper in that folder which hasn’t been compiled yet instead of the pip-installed version that does include the compiled components. If you copy the test_okada.py file up a couple directories and then run it, I suspect you’ll see success! |
Hmm this is a bit contrary to how I thought Python handles files - I have tried running the script from my home directory and that's where I get the error message. Shouldn't in that case the home directory be the working directory, and no relative imports are necessary?.. |
Oh yeah I missed that line at the top of your copied output! Good point. Either way, from the traceback, you can see that the import is loading up the copy of
You might have run |
Two debugging tips if you're interested:
|
Yeah it really does seem that even if I execute |
Hello Ben,
I was trying to install Okada Wrapper using the 'pip install Okada_Wrapper' but it just failed to build the wheel. I guess it could be caused by the Fortran compiler, but I can't locate where exactly the problem is. I wonder if you have any experience with this type of error. I would appreciate it very much!!! I'm so sorry that this error is just too long.
Best,
Xiaoyu
pip install okada_wrapper
Collecting okada_wrapper
Using cached okada_wrapper-18.12.07.3.tar.gz (11 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /opt/anaconda3/lib/python3.11/site-packages (from okada_wrapper) (1.26.4)
Building wheels for collected packages: okada_wrapper
Building wheel for okada_wrapper (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [780 lines of output]
/private/var/folders/bd/3zw60qqs3t531mslqqd9_kgc000t3m/T/pip-install-bub4sf_i/okada-wrapper_e1a0cec63b3f4f61872ca86b92d6c718/setup.py:1: DeprecationWarning:
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for okada_wrapper
Running setup.py clean for okada_wrapper
Failed to build okada_wrapper
ERROR: Could not build wheels for okada_wrapper, which is required to install pyproject.toml-based projects
The text was updated successfully, but these errors were encountered: