Skip to content

Exception on import #10

Description

@chrisspen

Vpython is unable to be imported on Ubuntu 16.04.

$ virtualenv .env
$ . .env/bin/activate
$ pip install vpython
Collecting vpython
Downloading vpython-1.0.9.tar.gz (2.5MB)
100% |################################| 2.5MB 451kB/s Collecting jupyter (from vpython)
Downloading jupyter-1.0.0-py2.py3-none-any.whl
Collecting vpnotebook (from vpython)
Downloading vpnotebook-0.1.3.zip
Collecting ipykernel (from jupyter->vpython)
Downloading ipykernel-4.5.0-py2.py3-none-any.whl (97kB)
100% |################################| 102kB 1.5MB/s Collecting jupyter-console (from jupyter->vpython)
Downloading jupyter_console-5.0.0-py2.py3-none-any.whl
Collecting qtconsole (from jupyter->vpython)
Downloading qtconsole-4.2.1-py2.py3-none-any.whl (104kB)
100% |################################| 112kB 1.2MB/s Collecting notebook (from jupyter->vpython)
Downloading notebook-4.2.3-py2.py3-none-any.whl (6.7MB)
100% |################################| 6.7MB 193kB/s Collecting ipywidgets (from jupyter->vpython)
Downloading ipywidgets-5.2.2-py2.py3-none-any.whl (43kB)
100% |################################| 51kB 4.5MB/s Collecting nbconvert (from jupyter->vpython)
Downloading nbconvert-4.2.0-py2.py3-none-any.whl (319kB)
100% |################################| 327kB 2.0MB/s Collecting ipython>=4.0.0 (from ipykernel->jupyter->vpython)
Using cached ipython-5.1.0-py2-none-any.whl
Collecting traitlets>=4.1.0 (from ipykernel->jupyter->vpython)
Downloading traitlets-4.3.1-py2.py3-none-any.whl (74kB)
100% |################################| 81kB 2.7MB/s Requirement already satisfied (use --upgrade to upgrade): tornado>=4.0 in /usr/lib/python2.7/dist-packages (from ipykernel->jupyter->vpython)
Collecting jupyter-client (from ipykernel->jupyter->vpython)
Downloading jupyter_client-4.4.0-py2.py3-none-any.whl (76kB)
100% |################################| 81kB 1.4MB/s Collecting prompt-toolkit<2.0.0,>=1.0.0 (from jupyter-console->jupyter->vpython)
Downloading prompt_toolkit-1.0.8-py2-none-any.whl (240kB)
100% |################################| 245kB 2.3MB/s Requirement already satisfied (use --upgrade to upgrade): pygments in /usr/lib/python2.7/dist-packages (from jupyter-console->jupyter->vpython)
Collecting jupyter-core (from qtconsole->jupyter->vpython)
Downloading jupyter_core-4.2.0-py2.py3-none-any.whl (76kB)
100% |################################| 81kB 5.5MB/s Collecting ipython-genutils (from notebook->jupyter->vpython)
Using cached 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 2.1MB/s Requirement already satisfied (use --upgrade to upgrade): jinja2 in /myproject/.env/lib/python2.7/site-packages (from notebook->jupyter->vpython)
Collecting terminado>=0.3.3; sys_platform != "win32" (from notebook->jupyter->vpython)
Downloading terminado-0.6.tar.gz
Collecting widgetsnbextension>=1.2.6 (from ipywidgets->jupyter->vpython)
Downloading widgetsnbextension-1.2.6-py2.py3-none-any.whl (1.5MB)
100% |################################| 1.5MB 829kB/s Collecting entrypoints (from nbconvert->jupyter->vpython)
Downloading entrypoints-0.2.2-py2.py3-none-any.whl
Collecting mistune!=0.6 (from nbconvert->jupyter->vpython)
Downloading mistune-0.7.3-py2.py3-none-any.whl
Collecting pickleshare (from ipython>=4.0.0->ipykernel->jupyter->vpython)
Using cached pickleshare-0.7.4-py2.py3-none-any.whl
Collecting backports.shutil-get-terminal-size; python_version == "2.7" (from ipython>=4.0.0->ipykernel->jupyter->vpython)
Using cached backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): decorator in /usr/lib/python2.7/dist-packages (from ipython>=4.0.0->ipykernel->jupyter->vpython)
Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in /usr/lib/python2.7/dist-packages (from ipython>=4.0.0->ipykernel->jupyter->vpython)
Requirement already satisfied (use --upgrade to upgrade): pexpect; sys_platform != "win32" in /usr/lib/python2.7/dist-packages (from ipython>=4.0.0->ipykernel->jupyter->vpython)
Collecting pathlib2; python_version == "2.7" or python_version == "3.3" (from ipython>=4.0.0->ipykernel->jupyter->vpython)
Using cached pathlib2-2.1.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): setuptools>=18.5 in /myproject/.env/lib/python2.7/site-packages (from ipython>=4.0.0->ipykernel->jupyter->vpython)
Requirement already satisfied (use --upgrade to upgrade): enum34; python_version == "2.7" in /usr/lib/python2.7/dist-packages (from traitlets>=4.1.0->ipykernel->jupyter->vpython)
Requirement already satisfied (use --upgrade to upgrade): six in /myproject/.env/lib/python2.7/site-packages (from traitlets>=4.1.0->ipykernel->jupyter->vpython)
Requirement already satisfied (use --upgrade to upgrade): pyzmq>=13 in /usr/lib/python2.7/dist-packages (from jupyter-client->ipykernel->jupyter->vpython)
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter->vpython)
Using cached wcwidth-0.1.7-py2.py3-none-any.whl
Collecting jsonschema!=2.5.0,>=2.0 (from nbformat->notebook->jupyter->vpython)
Downloading jsonschema-2.5.1-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in /myproject/.env/lib/python2.7/site-packages (from jinja2->notebook->jupyter->vpython)
Requirement already satisfied (use --upgrade to upgrade): ptyprocess in /usr/lib/python2.7/dist-packages (from terminado>=0.3.3; sys_platform != "win32"->notebook->jupyter->vpython)
Requirement already satisfied (use --upgrade to upgrade): configparser>=3.5; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from entrypoints->nbconvert->jupyter->vpython)
Collecting functools32; python_version == "2.7" (from jsonschema!=2.5.0,>=2.0->nbformat->notebook->jupyter->vpython)
Downloading functools32-3.2.3-2.zip
Building wheels for collected packages: vpython, vpnotebook, terminado, functools32
Running setup.py bdist_wheel for vpython ... done
Stored in directory: /home/chris/.cache/pip/wheels/90/06/31/8fc520c9ec44de940a4db5cd9e8bb93c2e24224e0b1c93c69b
Running setup.py bdist_wheel for vpnotebook ... error
Complete output from command /myproject/.env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-QU3baz/vpnotebook/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpcYA7nRpip-wheel- --python-tag cp27:
ImportError install_kernel_spec
/myproject/.env/local/lib/python2.7/site-packages/setuptools/dist.py:331: UserWarning: Normalizing '0.1.03' to '0.1.3'
normalized_version,
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/vpnotebook
copying vpnotebook/__init__.py -> build/lib.linux-x86_64-2.7/vpnotebook
creating build/lib.linux-x86_64-2.7/vpnotebook/data
copying vpnotebook/data/kernel.json -> build/lib.linux-x86_64-2.7/vpnotebook/data
installing to build/bdist.linux-x86_64/wheel
running install
Installing Python module...
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/vpnotebook
creating build/bdist.linux-x86_64/wheel/vpnotebook/data
copying build/lib.linux-x86_64-2.7/vpnotebook/data/kernel.json -> build/bdist.linux-x86_64/wheel/vpnotebook/data
copying build/lib.linux-x86_64-2.7/vpnotebook/__init__.py -> build/bdist.linux-x86_64/wheel/vpnotebook
running install_egg_info
running egg_info
writing vpnotebook.egg-info/PKG-INFO
writing top-level names to vpnotebook.egg-info/top_level.txt
writing dependency_links to vpnotebook.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'vpnotebook.egg-info/SOURCES.txt'
writing manifest file 'vpnotebook.egg-info/SOURCES.txt'
Copying vpnotebook.egg-info to build/bdist.linux-x86_64/wheel/vpnotebook-0.1.3-py2.7.egg-info
running install_scripts
Installing custom kernel ...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-QU3baz/vpnotebook/setup.py", line 30, in <module>
package_data={'vpnotebook': ['data/kernel.json']},
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/myproject/.env/local/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 235, in run
self.run_command('install')
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "vpnotebook/__init__.py", line 72, in run
run_kernel_install(False)
File "vpnotebook/__init__.py", line 63, in run_kernel_install
install_kernel_spec(source_dir, kernel_name='vpython', user=user)
NameError: free variable 'install_kernel_spec' referenced before assignment in enclosing scope
----------------------------------------
Failed building wheel for vpnotebook
Running setup.py clean for vpnotebook
Running setup.py bdist_wheel for terminado ... done
Stored in directory: /home/chris/.cache/pip/wheels/3b/c2/ea/af635ffb63857a8c2ddd22da6a4b52f5b7ea3065db94ef5d7c
Running setup.py bdist_wheel for functools32 ... done
Stored in directory: /home/chris/.cache/pip/wheels/3c/d0/09/cd78d0ff4d6cfecfbd730782a7815a4571cd2cd4d2ed6e69d9
Successfully built vpython terminado functools32
Failed to build vpnotebook
Installing collected packages: pathlib2, pickleshare, wcwidth, prompt-toolkit, ipython-genutils, traitlets, backports.shutil-get-terminal-size, ipython, jupyter-core, jupyter-client, ipykernel, jupyter-console, qtconsole, functools32, jsonschema, nbformat, entrypoints, mistune, nbconvert, terminado, notebook, widgetsnbextension, ipywidgets, jupyter, vpnotebook, vpython
Found existing installation: ipython 2.4.1
Not uninstalling ipython at /usr/lib/python2.7/dist-packages, outside environment /myproject/.env
Running setup.py install for vpnotebook ... done
Successfully installed backports.shutil-get-terminal-size-1.0.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 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 pickleshare-0.7.4 prompt-toolkit-1.0.8 qtconsole-4.2.1 terminado-0.6 traitlets-4.3.1 vpnotebook-0.1.3 vpython-1.0.9 wcwidth-0.1.7 widgetsnbextension-1.2.6
$ python
Python 2.7.12 (default, Jul 1 2016, 15:12:24) [GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import vpython
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/myproject/.env/local/lib/python2.7/site-packages/vpython/__init__.py", line 10, in <module>
from .vpython import *
File "/myproject/.env/local/lib/python2.7/site-packages/vpython/vpython.py", line 442, in <module>
get_ipython().kernel.comm_manager.register_target('glow', GlowWidget)
AttributeError: 'NoneType' object has no attribute 'kernel'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions