Skip to content
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

Cannot install pyKVFinder from PyPi... #17

Closed
hrp1000 opened this issue Jan 3, 2023 · 7 comments · Fixed by #18
Closed

Cannot install pyKVFinder from PyPi... #17

hrp1000 opened this issue Jan 3, 2023 · 7 comments · Fixed by #18
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@hrp1000
Copy link

hrp1000 commented Jan 3, 2023

Hi

I'm trying to install with pip on MacOS HIgh Sierra (old hardware, this is the newest OS I can install) as per the instructions on https://pypi.org/project/pyKVFinder/

[MacPro:~/icl/test] harry% pip install pyKVFinder
ERROR: Could not find a version that satisfies the requirement pyKVFinder (from versions: none)
ERROR: No matching distribution found for pyKVFinder

and

[MacPro:~/icl/test] harry% python3 -m pip install pyKVFinder
ERROR: Could not find a version that satisfies the requirement pyKVFinder (from versions: none)
ERROR: No matching distribution found for pyKVFinder

[MacPro:/icl/test] harry% python3 --version
Python 3.9.13
[MacPro:
/icl/test] harry% python3 -m pip --version
pip 22.3.1 from /Applications/miniconda3/lib/python3.9/site-packages/pip (python 3.9)

[MacPro:~/icl/test] harry% swig -version

SWIG Version 4.1.1

Compiled with /Applications/Xcode_13.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ [Darwin]

Configured options: +pcre

Please see https://www.swig.org for reporting bugs and further information

My assumption is that
(a) I'm doing something wrong
(b) something is missing on my system or
(c) my OS is too old :-(

any help would be appreciated!

@hrp1000
Copy link
Author

hrp1000 commented Jan 4, 2023

I think I've found the answer to this - pip install for this package seems to only work with OSX 10.14+ - getting lots of errors with "pip install -vv pyKVFinder" that have lines like these -

Skipping link: none of the wheel's tags (cp37-cp37m-macosx_10_14_x86_64) are compatible (run pi

Skipping link: none of the wheel's tags (cp310-cp310-macosx_10_15_x86_64) are compatible (run p

but lines like these indicate that if I had a Linux dating back 8 years or more pip install might work

Skipping link: none of the wheel's tags (cp39-cp39-manylinux2014_x86_64, cp39-cp39-manylinux_2_

so I guess I'll have to try to build it locally.

@jvsguerra jvsguerra self-assigned this Jan 4, 2023
@jvsguerra
Copy link
Member

Hi @hrp1000,

Thank you for reporting your issue.

There is no pyKVFinder distribution compatible with your OS (macOS High Sierra - 10.13) in PYPI. The oldest OS supported is macOS Catalina (10.15). I will carefully consider including macOS High Sierra in pyKVFinder deployment.

For now, please install the developmental version by building it locally.

To do this:

  1. Clone this repository
git clone https://github.com/LBC-LNBio/pyKVFinder
  1. Build pyKVFinder locally
pip install -e pyKVFinder/

Hope it helps you!
If you have more questions, feel free to ask me.

@jvsguerra jvsguerra added documentation Improvements or additions to documentation good first issue Good for newcomers labels Jan 4, 2023
@hrp1000
Copy link
Author

hrp1000 commented Jan 5, 2023

Thanks for the rapid repsonse.

Unfortunately, building pyKVFinder locally barfs -

running build_ext
building '_pyKVFinder' extension
swigging C/pyKVFinder.i to C/pyKVFinder_wrap.c
swig -python -o C/pyKVFinder_wrap.c C/pyKVFinder.i
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Applications/miniconda3/include -fPIC -O2 -isystem /Applications/miniconda3/include -I/Applications/miniconda3/lib/python3.9/site-packages/numpy/core/include -IC -I/Applications/miniconda3/include/python3.9 -c C/pyKVFinder.c -o build/temp.macosx-10.9-x86_64-cpython-39/C/pyKVFinder.o -fopenmp -Ofast -lm
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
clang: error: unsupported option '-fopenmp'
error: command '/usr/bin/clang' failed with exit code 1

removing the "-fopenmp" from compiler =flags gives other warnings and error.

I'm unfamiliar with swig - how do I change the default compiler from clang to gcc?

My clang looks like -

[MacPro:~/pykvfinder/pyKVFinder] harry% clang --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@jvsguerra
Copy link
Member

jvsguerra commented Jan 5, 2023

Hi again @hrp1000,

Compiling pyKVFinder uses gcc as the C compiler.
You must change the default compiler from clang to gcc, as you said above.
However, I managed to create a wheel for macOS High Sierra (10.13).

Wheel installation

I am sharing pyKVFinder wheels for different python versions here: wheels.zip

To install using the wheels, follow these steps:

  1. Unzip the wheels.zip.
unzip wheels.zip
  1. Install the pyKVFinder wheel using pip.
    Based on you first comment, you are using python 3.9, so you should run:
pip3 install pyKVFinder-0.4.5-cp39-cp39-macosx_10_13_x86_64.whl

Please let me know if the wheel installation worked.

Build from source

On the other hand, if you still want to build pyKVFinder from source.
First, you need to install:

  • Homebrew package manager;
  • Command Line Tools (CLT) for Xcode (xcode-select --install) or
    Xcode.

To install the available default version of GCC on your Homebrew
package manager, type:

brew install gcc

Note: check the GCC version, using brew info gcc, to make sure you
have installed a version later than 10. Also, Homebrew installation
will not override Clang LLVM compiler link.

If the default version GCC is not later than 10, you can install it directly by typing:

# GCC version 10
$ brew install gcc@10

Then, to set GCC as the default C compiler to build pyKVFinder from source, you would type:

  • Create a symbolic link to your custom GCC
$ sudo ln -s $(brew --prefix)/bin/gcc-X /usr/local/bin/gcc

Note: X is the version of GCC you have installed.

If you have more questions, feel free to ask me.

@hrp1000
Copy link
Author

hrp1000 commented Jan 9, 2023

Hi João

The wheel installation seems to work - "import pyKVFinder" and "help(pyKVFinder)" both give sensible replies at the python3 prompt.

Many thanks for this!

@hrp1000 hrp1000 closed this as completed Jan 9, 2023
@jvsguerra
Copy link
Member

Thanks for reporting this issue, @hrp1000.
If you have any questions, you can open a new issue or reopen this one.

@jvsguerra jvsguerra linked a pull request Feb 25, 2023 that will close this issue
@jvsguerra
Copy link
Member

Following up on this issue, pyKVFinder builds in PYPI are now compatible with older versions of macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants