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

ImportError during pip installation of mtuq #253

Open
jwebster-LANL opened this issue Feb 26, 2024 · 1 comment
Open

ImportError during pip installation of mtuq #253

jwebster-LANL opened this issue Feb 26, 2024 · 1 comment

Comments

@jwebster-LANL
Copy link

I searched mtuq's issues and didn't find this, but I'm not the only person who has had this issue, as other colleagues have as well. This popped up while installing mtuq via pip using the command

>> pip install https://github.com/uafgeotools/mtuq.git

or through a conda installation yml file:

- pip:
  - git+https://github.com/uafgeotools/mtuq.git

pip will create a folder in the file system's /tmp folder and will try to compile things there. If, however, the noexec flag is set on that folder (usually when mounted using the /etc/fstab file), the installer will return an ImportError that looks something like:

ImportError: /tmp/pip-build-env-ot0llisc/overlay/lib/python3.11/site-packages/numpy/core/[_multiarray_umath.cpython-311-x86_64-linux-gnu.so](https://urldefense.com/v3/__http://_multiarray_umath.cpython-311-x86_64-linux-gnu.so__;!!Bt8fGhp8LhKGRg!HKp84Ietwm74DPIDbrML2aU3dfpZ9ok60WBJ-mNvAZb-yv3fBvisAc3dx1kA40QvLlz9r7U3u0B08civ5-4sogmi5dbc0M0$): failed to map segment from shared object

There are at least two ways to fix this, the best one seems to be to set the TMPDIR environment variable to point to a directory that has doesn't have the noexec flag set. I use the tmp directory in my home folder...

>> export TMPDIR=~/tmp/

and that should allow the pip installation of mtuq to work.

Alternatively you can remove the noexec flag from where the /tmp folder is mounted in /etc/fstab, but that can be a security issue. Generally you don't want things in /tmp to be executable.

I think TMPDIR could be set at the start of the setup.py script and unset after it's finished, but I'm not sure that's a good approach.

Perhaps a note could be put in the troubleshooting section of the documentation explaining this and the solution? It's happened to a few people I know, and the solution isn't obvious for most people.

We are using various versions of RedHat Enterprise linux btw.

Thanks

@rmodrak
Copy link
Member

rmodrak commented Feb 27, 2024

Thanks for this report. A lot related forum discussion as you were saying

pypa/pip#4462

https://stackoverflow.com/questions/67115835/how-to-change-pip-unpacking-folder

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

No branches or pull requests

2 participants