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\
答案 0 :(得分:4)
立即修复是在安装vpnotebook之前安装jupyter:
pip install jupyter
感谢您报告此事;在将来发布的@ user1114907位置或主要的github回购中发布的问题:https://github.com/BruceSherwood/vpython-jupyter/issues
答案 1 :(得分:1)
这似乎是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。
答案 2 :(得分:0)
如果您的python版本大于2.7.9,请跳至步骤3
安装python版本&gt; 2.7.9 [2.7.14是最新的]
./configure
make
make install
下载并重新安装pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
安装jupyter First
sudo pip install jupyter
然后,安装vpython
sudo pip install vpython