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

The C extension is not available. Switching to fallback python pure algorithms #30

Open
mohammad2611373 opened this issue Jan 7, 2018 · 15 comments
Assignees
Labels

Comments

@mohammad2611373
Copy link

What to do with this warning?

@pylover
Copy link
Owner

pylover commented Jan 15, 2018

Install C compiler and python headers on your machine

@pylover pylover reopened this Jan 15, 2018
@pylover
Copy link
Owner

pylover commented Jan 15, 2018

Please mention your environement

@mhosseinab
Copy link

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.

@ehsanonline
Copy link

I have The same issu.
ubuntu server 16.04 , python 3.6 , virtualenv
i tried installing build-essential but it was not helpful.

@pylover
Copy link
Owner

pylover commented Nov 4, 2018

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.

@ehsanonline
Copy link

ehsanonline commented Jan 22, 2019

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!

@pylover pylover self-assigned this Jan 22, 2019
@fstackgeek
Copy link

what to do with this warning on windows?

Environment:
windows 10
python 3.8

@Mahyar24
Copy link

Mahyar24 commented Jun 5, 2020

I have The same issue.
Ubuntu server 18.04, python 3.6

@ehsanonline
Copy link

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

@Aquarii
Copy link

Aquarii commented Dec 14, 2022

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

@pylover
Copy link
Owner

pylover commented Dec 15, 2022

Just throw your Window$ away 😉 , 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).

@Aquarii
Copy link

Aquarii commented Dec 18, 2022

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?

@pylover
Copy link
Owner

pylover commented Dec 20, 2022

It seems Ok,

Let me check it on Ubuntu 22.04.

@pylover
Copy link
Owner

pylover commented Dec 20, 2022

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.

@dev4min
Copy link

dev4min commented Mar 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants