无法从其网站上获得Vpython版本,但是根据https://groups.google.com/forum/#!topic/vpython-users/AmIZF2v4Wkc,“ pip install vpython”应适用于任何版本的Python。
我在Windows命令提示符下输入了“ pip install vpython”。下载几分钟后,pip给了我以下错误:

  Running setup.py install for vpnotebook ... error
    Complete output from command c:\users\zachary\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Zachary\\AppData\\Local\\Temp\\pip-build-dx_wvbg0\\vpnotebook\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Zachary\AppData\Local\Temp\pip-3q5u2e2l-record\install-record.txt --single-version-externally-managed --compile:
    ImportError install_kernel_spec
    c:\users\zachary\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\dist.py:331: UserWarning: Normalizing '0.1.03' to '0.1.3'
      normalized_version,
    running install
    Installing Python module...
    running build
    running build_py
    creating build
    creating build\lib
    creating build\lib\vpnotebook
    copying vpnotebook\__init__.py -> build\lib\vpnotebook
    creating build\lib\vpnotebook\data
    copying vpnotebook\data\kernel.json -> build\lib\vpnotebook\data
    running install_lib
    creating c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook
    creating c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook\data
    copying build\lib\vpnotebook\data\kernel.json -> c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook\data
    copying build\lib\vpnotebook\__init__.py -> c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook
    byte-compiling c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook\__init__.py to __init__.cpython-36.pyc
    running install_egg_info
    running egg_info
    writing vpnotebook.egg-info\PKG-INFO
    writing dependency_links to vpnotebook.egg-info\dependency_links.txt
    writing top-level names to vpnotebook.egg-info\top_level.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 c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook-0.1.3-py3.6.egg-info
    running install_scripts
    writing list of installed files to 'C:\Users\Zachary\AppData\Local\Temp\pip-3q5u2e2l-record\install-record.txt'
    Installing custom kernel ...
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Zachary\AppData\Local\Temp\pip-build-dx_wvbg0\vpnotebook\setup.py", line 30, in <module>
        package_data={'vpnotebook': ['data/kernel.json']},
      File "c:\users\zachary\appdata\local\programs\python\python36-32\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\users\zachary\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "c:\users\zachary\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\Zachary\AppData\Local\Temp\pip-build-dx_wvbg0\vpnotebook\vpnotebook\__init__.py", line 72, in run
        run_kernel_install(False)
      File "C:\Users\Zachary\AppData\Local\Temp\pip-build-dx_wvbg0\vpnotebook\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

    ----------------------------------------
Command "c:\users\zachary\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Zachary\\AppData\\Local\\Temp\\pip-build-dx_wvbg0\\vpnotebook\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Zachary\AppData\Local\Temp\pip-3q5u2e2l-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Zachary\AppData\Local\Temp\pip-build-dx_wvbg0\vpnotebook\

最佳答案

这似乎是vpnotebook所依赖的vpython中的错误。尝试在Python 2.7和3.5中都安装vpnotebook失败,并显示相同的错误,这似乎是由软件包的作者甚至没有使用基本的linter引起的。我建议将其报告给上述作者,但there are no contact details, repositories, or project websites listed on the package's PyPI page

10-08 02:37