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

Numpy is required to build Mayavi correctly, please install it first #782

Open
loeiten opened this issue May 24, 2019 · 2 comments
Open

Comments

@loeiten
Copy link

loeiten commented May 24, 2019

As with #657, I'm trying to add Mayavi to a package. However, when pip installing my package I get a different error when wheel is being built for collected packages

Numpy is required to build Mayavi correctly, please install it first.

I have numpy as a dependency as shown in the trace below.
What confuses me is that it appears that the build completes successfully.

Collecting boututils
  Downloading https://files.pythonhosted.org/packages/7e/6c/9b25180e450df06dc62c6898208cd0d2c564821174da262df6d079e6243c/boututils-0.1.2-py3-none-any.whl (68kB)
Collecting netCDF4 (from boututils)
  Downloading https://files.pythonhosted.org/packages/48/94/eacbf790ceb237bee5db9c54e7c225ff0898d6dd496166a21d7c57254eb5/netCDF4-1.5.1.2-cp36-cp36m-manylinux1_x86_64.whl (4.1MB)
Collecting numpy (from boututils)
  Downloading https://files.pythonhosted.org/packages/c1/e2/4db8df8f6cddc98e7d7c537245ef2f4e41a1ed17bf0c3177ab3cc6beac7f/numpy-1.16.3-cp36-cp36m-manylinux1_x86_64.whl (17.3MB)
Collecting scipy (from boututils)
  Downloading https://files.pythonhosted.org/packages/72/4c/5f81e7264b0a7a8bd570810f48cd346ba36faedbd2ba255c873ad556de76/scipy-1.3.0-cp36-cp36m-manylinux1_x86_64.whl (25.2MB)
Collecting future (from boututils)
  Downloading https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz (829kB)
Collecting matplotlib (from boututils)
  Downloading https://files.pythonhosted.org/packages/da/83/d989ee20c78117c737ab40e0318ea221f1aed4e3f5a40b4f93541b369b93/matplotlib-3.1.0-cp36-cp36m-manylinux1_x86_64.whl (13.1MB)
Collecting h5py (from boututils)
  Downloading https://files.pythonhosted.org/packages/30/99/d7d4fbf2d02bb30fb76179911a250074b55b852d34e98dd452a9f394ac06/h5py-2.9.0-cp36-cp36m-manylinux1_x86_64.whl (2.8MB)
Collecting bunch (from boututils)
  Downloading https://files.pythonhosted.org/packages/ef/bf/a4cf1779a4ffb4f610903fa08e15d1f4a8a2f4e3353a02afbe097c5bf4a8/bunch-1.0.1.tar.gz
Collecting PyQt5 (from boututils)
  Downloading https://files.pythonhosted.org/packages/6a/f4/6a63aafcee3efd2b156dc835d9c85ca99b24e80f8af89b6da5c46054fe43/PyQt5-5.12.2-5.12.3-cp35.cp36.cp37.cp38-abi3-manylinux1_x86_64.whl (61.5MB)
Collecting mayavi (from boututils)
  Downloading https://files.pythonhosted.org/packages/83/9e/293ba57353ed258c2f64d54bf00ca1447c1f38f4eb60d0e762ddec57bf51/mayavi-4.6.2.tar.bz2 (7.0MB)
Collecting cftime (from netCDF4->boututils)
  Downloading https://files.pythonhosted.org/packages/70/64/8ceadda42af3c1b27ee77005807e38c6d77baef28a8f9216b60577fddd71/cftime-1.0.3.4-cp36-cp36m-manylinux1_x86_64.whl (305kB)
Collecting kiwisolver>=1.0.1 (from matplotlib->boututils)
  Downloading https://files.pythonhosted.org/packages/f8/a1/5742b56282449b1c0968197f63eae486eca2c35dcd334bab75ad524e0de1/kiwisolver-1.1.0-cp36-cp36m-manylinux1_x86_64.whl (90kB)
Collecting cycler>=0.10 (from matplotlib->boututils)
  Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Collecting python-dateutil>=2.1 (from matplotlib->boututils)
  Downloading https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib->boututils)
  Downloading https://files.pythonhosted.org/packages/dd/d9/3ec19e966301a6e25769976999bd7bbe552016f0d32b577dc9d63d2e0c49/pyparsing-2.4.0-py2.py3-none-any.whl (62kB)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from h5py->boututils)
Collecting PyQt5_sip<13,>=4.19.14 (from PyQt5->boututils)
  Downloading https://files.pythonhosted.org/packages/4a/e2/0a2ab857a85e6c09ddd4ebc0bf03274557899d79e678bc78908b3856511b/PyQt5_sip-4.19.17-cp36-cp36m-manylinux1_x86_64.whl (67kB)
Collecting apptools (from mayavi->boututils)
  Downloading https://files.pythonhosted.org/packages/78/84/64764e2c87fcb7ad7521bdabc7c44c109b80691f94218cbddd5df2ee682c/apptools-4.4.0.tar.bz2 (241kB)
Collecting envisage (from mayavi->boututils)
  Downloading https://files.pythonhosted.org/packages/24/25/63a50574fd9af66345ee6dc0d4bac342e755f9ac868927ca0beae178725a/envisage-4.7.2.tar.gz (256kB)
Collecting pyface>=6.0.0 (from mayavi->boututils)
  Downloading https://files.pythonhosted.org/packages/d2/ff/9e54cbd6748c3421d9afa82b2e119eef1d47f3ba33bb0b790bcba9a134ca/pyface-6.1.0.tar.gz (5.3MB)
Collecting pygments (from mayavi->boututils)
  Downloading https://files.pythonhosted.org/packages/6e/00/c5cb5fc7c047da4af049005d0146b3a961b1a25d9cefbbe24bf0882a11ad/Pygments-2.4.0-py2.py3-none-any.whl (882kB)
Collecting traits>=4.6.0 (from mayavi->boututils)
  Downloading https://files.pythonhosted.org/packages/81/80/2b5bb0036bbd05b971546b0d3a942b97896122681d4c657edb12d299d891/traits-5.1.1.tar.gz (436kB)
Collecting traitsui>=6.0.0 (from mayavi->boututils)
  Downloading https://files.pythonhosted.org/packages/b3/23/4a8560fd1b445e65b440ffa668cf7264764387ad0a4dda58add0d5bbfc7d/traitsui-6.1.0.tar.gz (5.1MB)
Collecting vtk (from mayavi->boututils)
  Downloading https://files.pythonhosted.org/packages/22/f5/30e11e1ad21701e1cd185b046979107930419a74a5602c6b899dc8523fe4/vtk-8.1.2-cp36-cp36m-manylinux1_x86_64.whl (48.9MB)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from kiwisolver>=1.0.1->matplotlib->boututils)
Collecting configobj (from apptools->mayavi->boututils)
  Downloading https://files.pythonhosted.org/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz
Building wheels for collected packages: future, bunch, mayavi, apptools, envisage, pyface, traits, traitsui, configobj
  Running setup.py bdist_wheel for future: started
  Running setup.py bdist_wheel for future: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/0c/61/d2/d6b7317325828fbb39ee6ad559dbe4664d0896da4721bf379e
  Running setup.py bdist_wheel for bunch: started
  Running setup.py bdist_wheel for bunch: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/56/0f/19/fbbf81e5764e6d8b74501c4357a88c14c94466ec777c03734c
  Running setup.py bdist_wheel for mayavi: started
  Running setup.py bdist_wheel for mayavi: finished with status 'error'
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-da6mxv1x/mayavi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp3j11y8nxpip-wheel- --python-tag cp36:
  ********************************************************************************

      Numpy is required to build Mayavi correctly, please install it first.

  ********************************************************************************
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-da6mxv1x/mayavi/setup.py", line 401, in <module>
      raise RuntimeError(msg)
  RuntimeError:
      Numpy is required to build Mayavi correctly, please install it first.


  ----------------------------------------
  Failed building wheel for mayavi
  Running setup.py clean for mayavi
  Running setup.py bdist_wheel for apptools: started
  Running setup.py bdist_wheel for apptools: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/f9/9e/2a/981bab2267d8f7fa546568cd79440e6b61b4fc570ee071080e
  Running setup.py bdist_wheel for envisage: started
  Running setup.py bdist_wheel for envisage: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/c6/4e/b1/7fdc3b4f5d86e82f74e962ec368bd024d91105aee07b2e5c90
  Running setup.py bdist_wheel for pyface: started
  Running setup.py bdist_wheel for pyface: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/31/07/f9/08382ddf9705b65fb4c1d457dcd3f1df3ed25fb426fce6727d
  Running setup.py bdist_wheel for traits: started
  Running setup.py bdist_wheel for traits: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/c6/77/33/5d96f09820a86a1412633269f80ca747bdf33e6e168f988e16
  Running setup.py bdist_wheel for traitsui: started
  Running setup.py bdist_wheel for traitsui: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/c1/d1/f8/ce35ed6ab6636cca12dd26dbe4622b285a5062f8602b580c6e
  Running setup.py bdist_wheel for configobj: started
  Running setup.py bdist_wheel for configobj: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/f1/e4/16/4981ca97c2d65106b49861e0b35e2660695be7219a2d351ee0
Successfully built future bunch apptools envisage pyface traits traitsui configobj
Failed to build mayavi
Installing collected packages: numpy, cftime, netCDF4, scipy, future, kiwisolver, cycler, python-dateutil, pyparsing, matplotlib, h5py, bunch, PyQt5-sip, PyQt5, configobj, traits, pyface, traitsui, apptools, envisage, pygments, vtk, mayavi, boututils
  Running setup.py install for mayavi: started
    Running setup.py install for mayavi: finished with status 'done'
@prabhuramachandran
Copy link
Member

Basically, it tries to install mayavi fails, then gets numpy and then succeeds building mayavi, so that seems like a red-herring. Does Mayavi work after this?

@loeiten
Copy link
Author

loeiten commented Jul 31, 2019

For my purposes it seems to work. However, due to display issues (I'm testing through a container) I cannot fully test whether it works or not. Running

from xvfbwrapper import Xvfb
vdisplay = Xvfb(width=1920, height=1080)
vdisplay.start()

from mayavi import mlab
mlab.options.offscreen = True
s = mlab.test_plot3d()

Gives the error

/usr/local/lib/python3.6/dist-packages/traits/etsconfig/etsconfig.py:420: UserWarning: Environment variable "HOME" not set, setting home directory to /tmp
  % (environment_variable, parent_directory)
ERROR: In /work/standalone-x64-build/VTK-source/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 445
vtkXOpenGLRenderWindow (0x2a3db40): bad X server connection. DISPLAY=:961343446. Aborting.

If you have another way of testing if it works, I'll gladly help :)

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