0

I'm trying to use pip to install various requirements in my virtualenv, but I can't get around the error Segementation fault (core dumped). That error seems to indicate memory access problems, but I don't understand how or why that would happen in a venv.

soverton@osr-ubuntu-2:~/Documents/eroi-erp$ pipenv --python 3.7.2
Warning: Python 3.7.2 was not found on your system…
Would you like us to install CPython 3.7.2 with pyenv? [Y/n]: Y
Error: invalid input
Would you like us to install CPython 3.7.2 with pyenv? [Y/n]: Y
Installing CPython 3.7.2 with pyenv (this may take a few minutes)…
✔ Success! 
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...
Installed Python-3.7.2 to /home/soverton/.pyenv/versions/3.7.2


Creating a virtualenv for this project…
Pipfile: /home/soverton/Pipfile
Using /home/soverton/.pyenv/versions/3.7.2/bin/python3.7m (3.7.2) to create virtualenv…
⠧ Creating virtual environment...Using base prefix '/home/soverton/.pyenv/versions/3.7.2'
Overwriting /home/soverton/.local/share/virtualenvs/soverton-mUoZmsRb/lib/python3.7/orig-prefix.txt with new content
New python executable in /home/soverton/.local/share/virtualenvs/soverton-mUoZmsRb/bin/python3.7m
Not overwriting existing python script /home/soverton/.local/share/virtualenvs/soverton-mUoZmsRb/bin/python (you must use /home/soverton/.local/share/virtualenvs/soverton-mUoZmsRb/bin/python3.7m)
Command /home/soverton/.loca...ZmsRb/bin/python3.7m -m pip config list had error code -11
Installing setuptools, pip, wheel...
done.
Running virtualenv with interpreter /home/soverton/.pyenv/versions/3.7.2/bin/python3.7m
✔ Successfully created virtual environment! 
Virtualenv location: /home/soverton/.local/share/virtualenvs/soverton-mUoZmsRb
Creating a Pipfile for this project…
soverton@osr-ubuntu-2:~/Documents/eroi-erp$ pipenv shell
Launching subshell in virtual environment…
 . /home/soverton/.local/share/virtualenvs/soverton-mUoZmsRb/bin/activate
soverton@osr-ubuntu-2:~$  . /home/soverton/.local/share/virtualenvs/soverton-mUoZmsRb/bin/activate
(soverton) soverton@osr-ubuntu-2:~/Documents/eroi-erp$ pip install django
Segmentation fault (core dumped)
(soverton) soverton@osr-ubuntu-2:~/Documents/eroi-erp$ pip
Segmentation fault (core dumped)
(soverton) soverton@osr-ubuntu-2:~/Documents/eroi-erp$ pip3
Segmentation fault (core dumped)
philMarius
  • 118
  • 6
Shaun Overton
  • 221
  • 3
  • 10
  • Are you sure you are running the pip that you intend to run? try to issue the command: which pip. – Eddie Dunn Mar 08 '19 at 18:15
  • It looks like it's running pip from the venv: `(soverton) soverton@osr-ubuntu-2:~/Documents/eroi-erp$ which pip /home/soverton/.local/share/virtualenvs/soverton-mUoZmsRb/bin/pip` – Shaun Overton Mar 08 '19 at 18:24
  • Also, I confirmed that user soverton has read-write permissions on that folder – Shaun Overton Mar 08 '19 at 18:36

2 Answers2

0

I solved this by first creating an environment using Python 3.6: pipenv --python 3.6. In this environment, both pip and pip3 worked. I then exited this environment, deleted both Pipfile and Pipfile.lock and then created another environment using pipenv --python 3.7.2 in the same directory and both pip and pip3 worked again.

I guess it must be an issue with Python 3.7.2?

Edit:

As Shaun mentioned below, it could be to do with anaconda being installed alongside vanilla Python and removing anaconda fixed it.

philMarius
  • 118
  • 6
0

first find out the location of pip.

run which pip

The output will points to a file. just rename the file with extension .py That's it