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

Virutalenv support for building bottleneck #396

Closed
Zeitsperre opened this issue Feb 10, 2022 · 2 comments
Closed

Virutalenv support for building bottleneck #396

Zeitsperre opened this issue Feb 10, 2022 · 2 comments

Comments

@Zeitsperre
Copy link

I have been trying to get Bottleneck to build from master using Python3.10 in the GitHub Actions environment. After finding the deadsnakes python action for installing the python-dev headers in Ubuntu 20.04 (https://github.com/deadsnakes/action), I was still having issues with the builds failing (despite everything working fine locally).

The fix to this issue raised here was actually solved by my colleague @aulemahal in another issue. I am opening this issue for context, with a PR incoming.

Explanation:

I believe I have found the source of the error, at least in my configuration. It is due to the specific of virtual environment creation with python -m venv.

When creating a virtual environment with venv into ${venv}, a ${venv}/include folder is created and sys.prefix == ${venv}. However, in opposition to virtualenv, the include folder is empty, it exists solely for files created by packages installed within the environment. Source : PEP 405.

The include folders needed by bottleneck are still accessible, but their path has to be constructed relative to sys.base_prefix instead, to get the system files. Changing:

for prefix in [sys.prefix, sys.exec_prefix]:

to

    for prefix in [sys.prefix, sys.exec_prefix, sys.base_prefix]:

fixes the problem.

Of course, I have pythonX.X-dev installed (on ubuntu) for this to work.

EDIT: I have python 3.7.9.

Originally posted by @aulemahal in #348 (comment)

@chaseleif
Copy link

Thanks, this worked for me too. I was getting stuck on bottleneck not installing, this solved my issue.
Python 3.10.2, pip 22.0.3, Arch Linux 5.16.10

@Zeitsperre
Copy link
Author

This appears to be fixed in the latest Bottleneck (v1.3.4). Thanks!

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

Successfully merging a pull request may close this issue.

2 participants