Can't import module visual in CentOS7

61 views
Skip to first unread message

Yansi Yao

unread,
Sep 20, 2016, 7:53:42 AM9/20/16
to VPython-users
Hi all,
My system environment is:
CentOS7, Python 2.7.5,

Here is how I install vpython with pip:
$ sudo pip install vpython
Collecting vpython
  Using cached vpython-1.0.8.tar.gz
Collecting jupyter (from vpython)
  Using cached jupyter-1.0.0-py2.py3-none-any.whl
Collecting vpnotebook (from vpython)
  Using cached vpnotebook-0.1.3.zip
Collecting ipywidgets (from jupyter->vpython)
  Using cached ipywidgets-5.2.2-py2.py3-none-any.whl
Collecting notebook (from jupyter->vpython)
  Downloading notebook-4.2.3-py2.py3-none-any.whl (6.7MB)
    100% |████████████████████████████████| 6.7MB 67kB/s
Collecting ipykernel (from jupyter->vpython)
  Downloading ipykernel-4.5.0-py2.py3-none-any.whl (97kB)
    100% |████████████████████████████████| 102kB 164kB/s
Collecting qtconsole (from jupyter->vpython)
  Downloading qtconsole-4.2.1-py2.py3-none-any.whl (104kB)
    100% |████████████████████████████████| 112kB 224kB/s
Collecting jupyter-console (from jupyter->vpython)
  Downloading jupyter_console-5.0.0-py2.py3-none-any.whl
Collecting nbconvert (from jupyter->vpython)
  Downloading nbconvert-4.2.0-py2.py3-none-any.whl (319kB)
    100% |████████████████████████████████| 327kB 217kB/s
Collecting traitlets>=4.2.1 (from ipywidgets->jupyter->vpython)
  Downloading traitlets-4.3.0-py2.py3-none-any.whl (74kB)
    100% |████████████████████████████████| 81kB 210kB/s
Collecting ipython>=4.0.0 (from ipywidgets->jupyter->vpython)
  Downloading ipython-5.1.0-py2-none-any.whl (747kB)
    100% |████████████████████████████████| 747kB 127kB/s
Collecting widgetsnbextension>=1.2.6 (from ipywidgets->jupyter->vpython)
  Downloading widgetsnbextension-1.2.6-py2.py3-none-any.whl (1.5MB)
    100% |████████████████████████████████| 1.5MB 164kB/s
Collecting tornado>=4 (from notebook->jupyter->vpython)
  Downloading tornado-4.4.1.tar.gz (456kB)
    100% |████████████████████████████████| 460kB 241kB/s
Collecting terminado>=0.3.3; sys_platform != "win32" (from notebook->jupyter->vpython)
  Downloading terminado-0.6.tar.gz
Collecting jupyter-core (from notebook->jupyter->vpython)
  Downloading jupyter_core-4.2.0-py2.py3-none-any.whl (76kB)
    100% |████████████████████████████████| 81kB 312kB/s
Collecting jinja2 (from notebook->jupyter->vpython)
  Downloading Jinja2-2.8-py2.py3-none-any.whl (263kB)
    100% |████████████████████████████████| 266kB 129kB/s
Collecting ipython-genutils (from notebook->jupyter->vpython)
  Downloading ipython_genutils-0.1.0-py2.py3-none-any.whl
Collecting nbformat (from notebook->jupyter->vpython)
  Downloading nbformat-4.1.0-py2.py3-none-any.whl (140kB)
    100% |████████████████████████████████| 143kB 218kB/s
Collecting jupyter-client (from notebook->jupyter->vpython)
  Downloading jupyter_client-4.4.0-py2.py3-none-any.whl (76kB)
    100% |████████████████████████████████| 81kB 228kB/s
Collecting pygments (from qtconsole->jupyter->vpython)
  Downloading Pygments-2.1.3-py2.py3-none-any.whl (755kB)
    100% |████████████████████████████████| 757kB 256kB/s
Collecting prompt-toolkit<2.0.0,>=1.0.0 (from jupyter-console->jupyter->vpython)
  Downloading prompt_toolkit-1.0.7-py2-none-any.whl (237kB)
    100% |████████████████████████████████| 245kB 363kB/s
Collecting mistune!=0.6 (from nbconvert->jupyter->vpython)
  Downloading mistune-0.7.3-py2.py3-none-any.whl
Collecting entrypoints (from nbconvert->jupyter->vpython)
  Downloading entrypoints-0.2.2-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): decorator in /usr/lib/python2.7/site-packages (from traitlets>=4.2.1->ipywidgets->jupyter->vpython)
Requirement already satisfied (use --upgrade to upgrade): enum34; python_version == "2.7" in /usr/lib/python2.7/site-packages (from traitlets>=4.2.1->ipywidgets->jupyter->vpython)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/site-packages (from traitlets>=4.2.1->ipywidgets->jupyter->vpython)
Collecting setuptools>=18.5 (from ipython>=4.0.0->ipywidgets->jupyter->vpython)
  Downloading setuptools-27.2.0-py2.py3-none-any.whl (465kB)
    100% |████████████████████████████████| 471kB 172kB/s
Collecting backports.shutil-get-terminal-size; python_version == "2.7" (from ipython>=4.0.0->ipywidgets->jupyter->vpython)
  Downloading backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl
Collecting simplegeneric>0.8 (from ipython>=4.0.0->ipywidgets->jupyter->vpython)
  Downloading simplegeneric-0.8.1.zip
Collecting pickleshare (from ipython>=4.0.0->ipywidgets->jupyter->vpython)
  Downloading pickleshare-0.7.4-py2.py3-none-any.whl
Collecting pexpect; sys_platform != "win32" (from ipython>=4.0.0->ipywidgets->jupyter->vpython)
  Downloading pexpect-4.2.1-py2.py3-none-any.whl (55kB)
    100% |████████████████████████████████| 61kB 214kB/s
Collecting pathlib2; python_version == "2.7" or python_version == "3.3" (from ipython>=4.0.0->ipywidgets->jupyter->vpython)
  Downloading pathlib2-2.1.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): backports.ssl_match_hostname in /usr/lib/python2.7/site-packages (from tornado>=4->notebook->jupyter->vpython)
Collecting singledispatch (from tornado>=4->notebook->jupyter->vpython)
  Downloading singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting certifi (from tornado>=4->notebook->jupyter->vpython)
  Downloading certifi-2016.8.31-py2.py3-none-any.whl (379kB)
    100% |████████████████████████████████| 389kB 248kB/s
Collecting backports_abc>=0.4 (from tornado>=4->notebook->jupyter->vpython)
  Downloading backports_abc-0.4-py2.py3-none-any.whl
Collecting ptyprocess (from terminado>=0.3.3; sys_platform != "win32"->notebook->jupyter->vpython)
  Downloading ptyprocess-0.5.1-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in /usr/lib64/python2.7/site-packages (from jinja2->notebook->jupyter->vpython)
Collecting jsonschema!=2.5.0,>=2.0 (from nbformat->notebook->jupyter->vpython)
  Downloading jsonschema-2.5.1-py2.py3-none-any.whl
Collecting pyzmq>=13 (from jupyter-client->notebook->jupyter->vpython)
  Downloading pyzmq-15.4.0-cp27-cp27mu-manylinux1_x86_64.whl (2.8MB)
    100% |████████████████████████████████| 2.8MB 143kB/s
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter->vpython)
  Downloading wcwidth-0.1.7-py2.py3-none-any.whl
Collecting configparser>=3.5; python_version == "2.7" (from entrypoints->nbconvert->jupyter->vpython)
  Downloading configparser-3.5.0.tar.gz
Collecting functools32; python_version == "2.7" (from jsonschema!=2.5.0,>=2.0->nbformat->notebook->jupyter->vpython)
  Downloading functools32-3.2.3-2.zip
Installing collected packages: ipython-genutils, traitlets, pygments, setuptools, backports.shutil-get-terminal-size, simplegeneric, pathlib2, pickleshare, ptyprocess, pexpect, wcwidth, prompt-toolkit, ipython, singledispatch, certifi, backports-abc, tornado, jupyter-core, pyzmq, jupyter-client, ipykernel, terminado, jinja2, functools32, jsonschema, nbformat, mistune, configparser, entrypoints, nbconvert, notebook, widgetsnbextension, ipywidgets, qtconsole, jupyter-console, jupyter, vpnotebook, vpython
  Found existing installation: setuptools 0.9.8
    Uninstalling setuptools-0.9.8:
      Successfully uninstalled setuptools-0.9.8
  Running setup.py install for simplegeneric ... done
  Running setup.py install for tornado ... done
  Running setup.py install for terminado ... done
  Running setup.py install for functools32 ... done
  Running setup.py install for configparser ... done
  Running setup.py install for vpnotebook ... done
  Running setup.py install for vpython ... done
Successfully installed backports-abc-0.4 backports.shutil-get-terminal-size-1.0.0 certifi-2016.8.31 configparser-3.5.0 entrypoints-0.2.2 functools32-3.2.3.post2 ipykernel-4.5.0 ipython-5.1.0 ipython-genutils-0.1.0 ipywidgets-5.2.2 jinja2-2.8 jsonschema-2.5.1 jupyter-1.0.0 jupyter-client-4.4.0 jupyter-console-5.0.0 jupyter-core-4.2.0 mistune-0.7.3 nbconvert-4.2.0 nbformat-4.1.0 notebook-4.2.3 pathlib2-2.1.0 pexpect-4.2.1 pickleshare-0.7.4 prompt-toolkit-1.0.7 ptyprocess-0.5.1 pygments-2.1.3 pyzmq-15.4.0 qtconsole-4.2.1 setuptools-27.2.0 simplegeneric-0.8.1 singledispatch-3.4.0.3 terminado-0.6 tornado-4.4.1 traitlets-4.3.0 vpnotebook-0.1.3 vpython-1.0.8 wcwidth-0.1.7 widgetsnbextension-1.2.6



But I can't import visual module:
$ python
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from visual import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named visual
>>>

And /usr/lib/python2.7/site-packages/ contains no visual sub-directory at all.

Could you give me any help?

Cheers
Yao

Bruce Sherwood

unread,
Sep 20, 2016, 11:56:31 AM9/20/16
to VPython-users
See the first page of vpython.org for how to use the Jupyter notebook version of VPython that you have installed. 

As the instructions there explain, you need to execute "jupyter notebook", then create a new notebook, then use "from vpython import *" or similar statement, not "from visual import *".

Can you describe where you saw documentation on how to use VPython? That would be helpful, because I don't know of any existing documentation that says to execute "from visual import *" in a terminal after using "pip install vpython".
Reply all
Reply to author
Forward
0 new messages