khayyam
khayyam copied to clipboard
The C extension is not available. Switching to fallback python pure algorithms
What to do with this warning?
Install C
compiler and python headers on your machine
Please mention your environement
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I have The same issu. ubuntu server 16.04 , python 3.6 , virtualenv i tried installing build-essential but it was not helpful.
You have to install python-dev
and or python3-dev
as well as the build-essential
package.
You man run python setup.py build_ext --inplace
to examine what library you missed and so, install them.
As I knew, the only C prerequisite of the khayyam
package is the python.h
.
Thanks!
I installed build-essential
, python3.6-dev
, python3-setuptools
and python3-dev
, then I ran these commands on the cloned khayyam:
python setup.py build_ext --inplace
nosetests
(it gives me errors though)
pip install -e .
(it reinstalled khayyam)
now that error is gone!
what to do with this warning on windows?
Environment: windows 10 python 3.8
I have The same issue. Ubuntu server 18.04, python 3.6
I made some pre-build versions here for those who can't build it. just extract and copy in your site-packages
folder instead of installing with pip
:
https://github.com/ehsanonline/khayyam_pre_build
Hi guys. would you mind explaining how to build it on win10 21h2?
Install
C
compiler and python headers on your machine
like how?
I've tried to get all the packages mentioned above (build-essential
, python-setuptools
and python-dev
) but I get this error for every single one of them:
ERROR: Could not find a version that satisfies the requirement python-dev (from versions: none)
ERROR: No matching distribution found for python-dev
I searched a lot but I don't seem to get it.
btw I'm using python 3.10.
could you explain it in more detail for a novice like me?
thank you
Just throw your Window$ away :wink: , Or: install the appropriate C compiler: https://wiki.python.org/moin/WindowsCompilers
But I highly recommend you to not develop anything on Micro$oft Window$ (Trust me, It's will be overkill).
I threw my windows away 😉 and did it in Debian 10. still the same.
gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
apt show python3-dev
Package: python3-dev
Version: 3.9.2-3
apt show python3-setuptools
Package: python3-setuptools
Version: 52.0.0-4
apt show build-essential
Package: build-essential
Version: 12.9
I installed it using the setup.py provided in the package, like this:
python setup.py install
did I do something wrong? any idea?
It seems Ok,
Let me check it on Ubuntu 22.04.
Everything is fine on a clean Ubuntu 22.04
.
path/to/khayyam$ python3 setup.py build_ext --inplace
running build_ext
building 'khayyam.algorithms_c' extension
creating build
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/khayyam
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.10 -c khayyam/algorithms_c.c -o build/temp.linux-x86_64-cpython-310/khayyam/algorithms_c.o
creating build/lib.linux-x86_64-cpython-310
creating build/lib.linux-x86_64-cpython-310/khayyam
x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-x86_64-cpython-310/khayyam/algorithms_c.o -L/usr/lib/x86_64-linux-gnu -o build/lib.linux-x86_64-cpython-310/khayyam/algorithms_c.cpython-310-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-cpython-310/khayyam/algorithms_c.cpython-310-x86_64-linux-gnu.so -> khayyam
Make sure the appropriate C compiler is in your path and accessible to Python's setuptools
when needed.
As you see in the compilation output above, the x86_64-linux-gnu-gcc
command was utilized by setuptools
on my machine.
Thank you for this great library. 🙏
For God's sake, could you please remove this warning? It's really annoying! And also I'm happy with pure python speed! 😄
Because of that, I have to use this piece of code whenever I want to use this lib!
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=UserWarning)
from khayyam import JalaliDatetime