0

I am trying to install Twisted inside virtualenv:

mkvirtualenv --python=/usr/bin/python3 venv_stack

Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/buildbot/.envs/venv_stack/bin/python3
Also creating executable in /home/buildbot/.envs/venv_stack/bin/python
Installing setuptools, pip, wheel...
done.
virtualenvwrapper.user_scripts creating /home/buildbot/.envs/venv_stack/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/buildbot/.envs/venv_stack/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/buildbot/.envs/venv_stack/bin/preactivate
virtualenvwrapper.user_scripts creating /home/buildbot/.envs/venv_stack/bin/postactivate
virtualenvwrapper.user_scripts creating /home/buildbot/.envs/venv_stack/bin/get_env_details
pip install twisted
Building wheels for collected packages: twisted
  Building wheel for twisted (setup.py) ... error

the error basicly comes down to:

  x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/src/twisted/test/raiser.o -o build/lib.linux-x86_64-3.6/twisted/test/raiser.cpython-36m-x86_64-linux-gnu.so
  Traceback (most recent call last):
    File "/usr/local/bin/ld", line 4, in <module>
      import posix_ipc
  ModuleNotFoundError: No module named 'posix_ipc'
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for twisted

So I figure, one should install posix_ipc:

pip install posix_ipc
  Using cached https://files.pythonhosted.org/packages/c9/3e/54217da71aa26b488295d878df4d3132093253b4ae5798ac66fcb6921ef0/posix_ipc-1.0.4.tar.gz
Building wheels for collected packages: posix-ipc
  Building wheel for posix-ipc (setup.py) ... error

This error basically comes down to:

  Traceback (most recent call last):
    File "/usr/local/bin/ld", line 4, in <module>
      import posix_ipc
  ModuleNotFoundError: No module named 'posix_ipc'
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for posix-ipc

It looks like installation posix_ipc requires posix_ipc to be installed.

My current virtualenv/pip state:

pip freeze 
attrs==19.1.0
Automat==0.7.0
constantly==15.1.0
hyperlink==19.0.0
idna==2.8
incremental==17.5.0
PyHamcrest==1.9.0
six==1.12.0
zope.interface==4.6.0

All the packages were installed as part of Twisted installation.

Os:

lsb_release -d
Description:    Ubuntu 18.04.2 LTS

I am happy to extend or provide any information.

MarcinG
  • 840
  • 6
  • 21

1 Answers1

1

I also got this error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 error when installing M2Crypto and pygraphviz packages with Ubuntu 18.04.2 LTS. Seems you have miss to install some packages on ubuntu. So when I get this error, I go through all the below articles and install everything and finally successfully installed my packages.

So these are all the packages that I have installed so far my Ubuntu 18.04.2 LTS machine.

sudo apt-get update && apt-get install -y build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev libssl-dev swig graphviz-dev libxml2-dev libxslt-dev libffi-dev libpq-dev libxslt1-dev libldap2-dev libsasl2-dev python-dateutil python-docutils python-feedparser python-gdata python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python3-dev zlib1g-dev python3.6-dev

It will take some time. I added -y, then you don't need to type [Y/n] in every packages.After all the package installed run your pip command again and if get anything wrong please add a comment to this question. I also try to install posix_ipc and twisted packages which you can't, but I successfully installed both.

enter image description here

enter image description here

I hope this will help you somehow.

Kushan Gunasekera
  • 7,268
  • 6
  • 44
  • 58