Home > OS >  After install and uninstall a package, python3 crashes with error "Segmentation fault (core dum
After install and uninstall a package, python3 crashes with error "Segmentation fault (core dum

Time:10-17

The steps leading to the problem is as follows:

  1. I installed a package using pip. The package is here and its install doc is here. The command I used is

    pip install --upgrade tensorflow-graphics-gpu

Because I don't have super user privilege, the package was installed in my user space. pip prompted me for that.

  1. I uninstalled the package using

    pip uninstall tensorflow-graphics-gpu

  2. I started python3 and type

    import tensorflow as tf

This statement worked fine before. But this time, python quits with an error:

Segmentation fault (core dumped)

This is a screenshot: enter image description here.

The environment is as follows:

  1. A remote Linux. Core version 5.8.0. I am not not a super user.
  2. Python 3.8.6
  3. CUDA 11.1
  4. CPU: Core i9-10900K
  5. nVidia RTX GPU

The same error crashes python if I tried to import PyTorch. The sys admin is very disagreeable so I can get no help from him, not to mention upgrading drivers or reinstalling python. I tried to clear cashes in my user space that I know of, but I didn't have luck. I searched internet for a solution but of no avail. Can someone please tell me how to fix this issue? Thanks a lot.

CodePudding user response:

I had some similar issues working on a remote system. I would recommend installing miniconda under your user directory. The process is quite straightforward. I have included a link below.

Essentially, you're just installing python again locally. Then you can use conda to manage modules and even create specific environments for different projects/use cases. You won't need root privileges to make changes.

https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html

CodePudding user response:

I tried to clear cashes in my user space that I know of, but I didn't have luck.

It seems pretty clear that something in your $HOME directory is still being used, and is causing the system python to crash.

To discover what that something is, you can look at which files are being opened using this command:

strace -e file python -c 'import tensorflow'

Once you know which files are being opened, remove/reinstall corresponding packages, and you should be back in business.

  • Related