无法安装JupyterLab for Python3.8 64bit

时间:2019-11-03 05:17:22

标签: python pip jupyter-lab

尽管我在互联网上搜索解决方案,但似乎没有任何效果。尤其是在

之后,发生了错误
Collecting pywinpty>=0.5; os_name == "nt"

出于类似原因,我无法安装pyaudio。我已安装Visual Studio 2017(已卸载以前的版本)。这是一些日志-

Collecting pywinpty>=0.5; os_name == "nt"
Using cached https://files.pythonhosted.org/packages/21/ae/acbedcee475d049647e45ee949e23ca492764fcd8027a073fcf07646d47c/pywinpty-0.5.5.tar.gz
ERROR: Command errored out with exit status 1:
 command: 'C:\Users\probh\AppData\Local\Programs\Python\Python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\probh\\AppData\\Local\\Temp\\pip-install-ui27dqrw\\pywinpty\\setup.py'"'"'; __file__='"'"'C:\\Users\\probh\\AppData\\Local\\Temp\\pip-install-ui27dqrw\\pywinpty\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\probh\AppData\Local\Temp\pip-install-ui27dqrw\pywinpty\pip-egg-info'
     cwd: C:\Users\probh\AppData\Local\Temp\pip-install-ui27dqrw\pywinpty\
Complete output (184 lines):
Compiling C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Plex\Scanners.py because it changed.
Compiling C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Plex\Actions.py because it changed.
Compiling C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Compiler\Scanning.py because it changed.
Compiling C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Compiler\Visitor.py because it changed.
Compiling C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Compiler\FlowControl.py because it changed.
Compiling C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Runtime\refnanny.pyx because it changed.
Compiling C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Compiler\FusedNode.py because it changed.
Compiling C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Tempita\_tempita.py because it changed.
[1/8] Cythonizing C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Compiler\FlowControl.py
[2/8] Cythonizing C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Compiler\FusedNode.py
[3/8] Cythonizing C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Compiler\Scanning.py
[4/8] Cythonizing C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Compiler\Visitor.py
[5/8] Cythonizing C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Plex\Actions.py
[6/8] Cythonizing C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Plex\Scanners.py
[7/8] Cythonizing C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Runtime\refnanny.pyx
[8/8] Cythonizing C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\Cython\Tempita\_tempita.py
Unable to find pgen, not compiling formal grammar.
warning: no files found matching 'Doc\*'
warning: no files found matching '*.pyx' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.pxd' under directory 'Cython\Debugger\Tests'
warning: no files found matching '*.pxd' under directory 'Cython\Utility'
warning: no files found matching 'pyximport\README'
Traceback (most recent call last):
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
    yield saved
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\setup.py", line 228, in <module>
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\bdist_egg.py", line 172, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\bdist_egg.py", line 158, in call_command
    self.run_command(cmdname)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
    self.build()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\command\install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
    _build_ext.run(self)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\build_ext.py", line 205, in build_extension
    _build_ext.build_extension(self, ext)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\command\build_ext.py", line 528, in build_extension
    objects = self.compiler.compile(sources,
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\_msvccompiler.py", line 360, in compile
    self.initialize()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\_msvccompiler.py", line 253, in initialize
    vc_env = _get_vc_env(plat_spec)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\msvc.py", line 171, in msvc14_get_vc_env
    return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\msvc.py", line 1620, in return_env
    if self.vs_ver >= 14 and isfile(self.VCRuntimeRedist):
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\genericpath.py", line 30, in isfile
    st = os.stat(path)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 311, in wrap
    return original(path, *args, **kw)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\probh\AppData\Local\Temp\pip-install-ui27dqrw\pywinpty\setup.py", line 68, in <module>
    setup(
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\__init__.py", line 144, in setup
    _install_setup_requires(attrs)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\dist.py", line 717, in fetch_build_eggs
    resolved_dists = pkg_resources.working_set.resolve(
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
    dist = best[req.key] = env.best_match(
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
    return self.obtain(req, installer)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
    return installer(requirement)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\dist.py", line 787, in fetch_build_egg
    return cmd.easy_install(req)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\easy_install.py", line 679, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\easy_install.py", line 705, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\easy_install.py", line 890, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\easy_install.py", line 1158, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\easy_install.py", line 1144, in run_setup
    run_setup(setup_script, args)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 253, in run_setup
    raise
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\_vendor\six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
    yield saved
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "C:\Users\probh\AppData\Local\Temp\easy_install-yasgogvz\Cython-0.29.14\setup.py", line 228, in <module>
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\bdist_egg.py", line 172, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\bdist_egg.py", line 158, in call_command
    self.run_command(cmdname)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
    self.build()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\command\install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
    _build_ext.run(self)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\build_ext.py", line 205, in build_extension
    _build_ext.build_extension(self, ext)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\command\build_ext.py", line 528, in build_extension
    objects = self.compiler.compile(sources,
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\_msvccompiler.py", line 360, in compile
    self.initialize()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\distutils\_msvccompiler.py", line 253, in initialize
    vc_env = _get_vc_env(plat_spec)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\msvc.py", line 171, in msvc14_get_vc_env
    return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\msvc.py", line 1620, in return_env
    if self.vs_ver >= 14 and isfile(self.VCRuntimeRedist):
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\genericpath.py", line 30, in isfile
    st = os.stat(path)
  File "C:\Users\probh\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\sandbox.py", line 311, in wrap
    return original(path, *args, **kw)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

2 个答案:

答案 0 :(得分:2)

pywinpty尚未与Python 3.8兼容:https://github.com/spyder-ide/pywinpty/issues/123

我的建议是:不要过早升级到Python 3.8。很好的Python是可以的,但是第三方模块还没有。

答案 1 :(得分:1)

我刚刚按照以下步骤安装了Python 3.8,然后安装了JupyterLab:

https://www.lfd.uci.edu/~gohlke/pythonlibs

下载 pyzmq pywinpty 滚轮文件

通过pip安装它们

pip install pywinpty-0.5.5-cp38-cp38-win_amd64.whl pyzmq-18.1.0-cp38-cp38-win_amd64.whl

然后安装JupyterLab

pip install jupyterlab

运行JupyterLab的最后一步是在龙卷风包中编辑asyncio.py。 在您的Python安装目录中,打开\ Lib \ site-packages \ tornado \ platform \ asyncio.py 并在导入异步后放置以下行

import sys
if sys.platform == 'win32':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) 

就是这样,JupyterLab应该可以发挥作用。

TL; DR

download latest versions of pyzmq and pywinpty from https://www.lfd.uci.edu/~gohlke/pythonlibs
pip install pywinpty-0.5.5-cp38-cp38-win_amd64.whl pyzmq-18.1.0-cp38-cp38-win_amd64.whl
pip install jupyterlab
edit \Lib\site-packages\tornado\platform\asyncio.py and put the following lines after import asyncio:

import sys
if sys.platform == 'win32':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())