Problem call jep when not root user
I call jep use admin, get the following error: But I can call jep normlly use user as root, I have installed python lib all of them(root and admin), so I want to know what's wrong, and how to solve it.
Traceback (most recent call last):
File "/home/admin/.local/lib/python3.6/site-packages/jep/shared_modules_hook.py", line 129, in load_module
self.sharedImporter.sharedImport(fullname)
ImportError: jep.JepException: Error importing shared module numpy
jep.JepException: <class 'ImportError'>: Error importing shared module numpy
at /home/admin/.local/lib/python3.6/site-packages/jep/shared_modules_hook.load_module(shared_modules_hook.py:129)
at
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy c-extensions failed.
-
Try uninstalling and reinstalling numpy.
-
If you have already done that, then:
- Check that you expected to use Python3.6 from "/usr/local/bin/python3", and that you have no directories in your PATH or PYTHONPATH that can interfere with the Python and numpy version "1.17.2" you're trying to use.
- If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
-
If you're working with a numpy git repository, try
git clean -xdf(removes all files not under version control) and rebuild numpy.
Note: this error has many possible causes, so please don't comment on an existing issue about this - open a new one instead.
Original error was: /home/admin/.local/lib/python3.6/site-packages/numpy/core/_multiarray_umath.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyExc_ImportError
at /home/admin/.local/lib/python3.6/site-packages/numpy/core/__init__.<module>(__init__.py:47)
at /home/admin/.local/lib/python3.6/site-packages/numpy/__init__.<module>(__init__.py:142)
at jep.MainInterpreter.sharedImportInternal(Native Method)
at jep.MainInterpreter.access$400(MainInterpreter.java:64)
at jep.MainInterpreter$1.run(MainInterpreter.java:168)
Usually an undefined symbol indicates there was a problem loading libpython. The simplest solution is often to set the LD_PRELOAD environmental variable to the path of libpython3.6m.so which will force loading of the library.
If it is working for the root user but not for other users I recommend first comparing the environemtn where you are running, various environmental variables such as PYTHONHOME, PYTHONPATH, LD_PRELOAD, and LD_LIBRARY_PATH can affect which libraries are loaded and how so I suspect one of those variables may be different.
If you continue to have problems pleaseinclude what version of jep you are using and what distribution and version of linux you are using.
I got similar issue. I have no root privilege and cannot modify LD_LIBRARY_PATH or LD_PRELOAD. I create an anaconda environment and installed numpy and jep in it. The python3 version is 3.9.2 and the jep version is 3.9.1. After running conda activate myenv, I can start python3 and do "import numpy" without error message. But when I run jep, it give the following error message: $ jep
No readline available. History will not be available.
You may want to set the LD_PRELOAD environment variable, see the
README file for details.
i.e.: export LD_PRELOAD=/usr/lib/libpython2.7.so.1.0
import numpy
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
- The Python version is: Python3.9 from "/data2/anaconda3/envs/myenv/bin/python3"
- The NumPy version is: "1.19.2"
and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.
Original error was: /data2/anaconda3/myenv/smt8/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-x86_64-linux-gnu.so: undefined symbol: PyModule_AddObject
solution: use jep github source code to build & install. All the path problems are solved.