microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.57k stars 901 forks source link

PowerShell notebook with Python 3.8 fails to upgrade packages #7823

Open wsmelton opened 5 years ago

wsmelton commented 5 years ago

Steps to Reproduce:

  1. Install Python 3.8.0: https://www.python.org/downloads/
  2. Set notebook configuration to Python path: "notebook.pythonPath": "C:\\Users\\Shawn Melton\\AppData\\Local\\Programs\\Python\\Python38-32" (For my install)
  3. Start a notebook
  4. Select PowerShell kernel

Result message from upgrade attempt:

Failed to change kernel. Kernel SQL will be used. Error was: Installing Notebook dependencies failed with error: Process exited with code 1

Video recording: ads_python8_notebook_upgradefailure.zip

Output pane shows:

Installing jupyter>=1.0.0 pandas>=0.24.2 sparkmagic>=0.12.9 prose-codeaccelerator>=1.3.0 in progress

image

chlafreniere commented 5 years ago

@corivera your fixes to help with stderr logging may help us diagnose this issue.

@wsmelton if you open the output window pane and select the "Notebooks" dropdown, you can see what packages we're trying to install. There may be some juicy info there that's pertinent. If so, could you paste in what's in the pane?

wsmelton commented 5 years ago

The recording shows that but I'll add it to the post.

wsmelton commented 5 years ago

Issue still occurs:

Version: 1.14.0-insider (system setup)
Commit: 5a392dfd5802aa84a871edf43193d830eeeb4d96
Date: 2019-11-05T19:53:39.538Z
VS Code: 1.38.0
Electron: 6.0.12
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18362

Some additional details seem to show up now:

image

Text from notification shows:

Failed to change kernel. Kernel SQL will be used. Error was: Installing Notebook dependencies failed with error: Process exited with  with error code: 1. StdErr Output:     ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Shawn Melton\\AppData\\Local\\Temp\\pip-install-vfyk67z6\\pywinpty\\setup.py'"'"'; __file__='"'"'C:\\Users\\Shawn Melton\\AppData\\Local\\Temp\\pip-install-vfyk67z6\\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\Shawn Melton\AppData\Local\Temp\pip-install-vfyk67z6\pywinpty\pip-egg-info'
         cwd: C:\Users\Shawn Melton\AppData\Local\Temp\pip-install-vfyk67z6\pywinpty\
    Complete output (147 lines):
    Unable to find pgen, not compiling formal grammar.
    Traceback (most recent call last):
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\command\bdist_egg.py", line 163, in run
        self.run_command("egg_info")
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\command\egg_info.py", line 283, in run
        self.mkpath(self.egg_info)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\distutils\cmd.py", line 338, in mkpath
        dir_util.mkpath(name, mode, dry_run=self.dry_run)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\distutils\dir_util.py", line 70, in mkpath
        os.mkdir(head, mode)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 310, in wrap
        path = self._remap_input(name, path, *args, **kw)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 452, in _remap_input
        self._violation(operation, os.path.realpath(path), *args, **kw)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 407, in _violation
        raise SandboxViolation(operation, args, kw)
    setuptools.sandbox.SandboxViolation: SandboxViolation: mkdir('C:\\Users\\SHAWNM~1\\AppData\\Local\\Temp\\easy_install-m436ch4b\\Cython-0.29.14\\Cython.egg-info', 511) {}

    The package setup script has attempted to modify files on your system
    that are not within the EasyInstall build area, and has been aborted.

    This package cannot be safely installed by EasyInstall, and may not
    support alternate installation locations even if you run its setup
    script by hand.  Please inform the package's author and the EasyInstall
    maintainers to find out if a fix or workaround is available.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\SHAWNM~1\AppData\Local\Temp\easy_install-m436ch4b\Cython-0.29.14\setup.py", line 228, in <module>
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\distutils\core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: SandboxViolation: mkdir('C:\\Users\\SHAWNM~1\\AppData\\Local\\Temp\\easy_install-m436ch4b\\Cython-0.29.14\\Cython.egg-info', 511) {}

    The package setup script has attempted to modify files on your system
    that are not within the EasyInstall build area, and has been aborted.

    This package cannot be safely installed by EasyInstall, and may not
    support alternate installation locations even if you run its setup
    script by hand.  Please inform the package's author and the EasyInstall
    maintainers to find out if a fix or workaround is available.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\command\easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 253, in run_setup
        raise
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\_vendor\six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\SHAWNM~1\AppData\Local\Temp\easy_install-m436ch4b\Cython-0.29.14\setup.py", line 228, in <module>
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\distutils\core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: SandboxViolation: mkdir('C:\\Users\\SHAWNM~1\\AppData\\Local\\Temp\\easy_install-m436ch4b\\Cython-0.29.14\\Cython.egg-info', 511) {}

    The package setup script has attempted to modify files on your system
    that are not within the EasyInstall build area, and has been aborted.

    This package cannot be safely installed by EasyInstall, and may not
    support alternate installation locations even if you run its setup
    script by hand.  Please inform the package's author and the EasyInstall
    maintainers to find out if a fix or workaround is available.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Shawn Melton\AppData\Local\Temp\pip-install-vfyk67z6\pywinpty\setup.py", line 68, in <module>
        setup(
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\dist.py", line 716, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
        dist = best[req.key] = env.best_match(
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
        return installer(requirement)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\dist.py", line 786, in fetch_build_egg
        return cmd.easy_install(req)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\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\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\command\easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "C:\Users\Shawn Melton\AppData\Local\Programs\Python\Python38-32\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\Shawn Melton\AppData\Local\Programs\Python\Python38-32\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\Shawn Melton\AppData\Local\Programs\Python\Python38-32\lib\site-packages\setuptools\command\easy_install.py", line 1146, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: SandboxViolation: mkdir('C:\\Users\\SHAWNM~1\\AppData\\Local\\Temp\\easy_install-m436ch4b\\Cython-0.29.14\\Cython.egg-info', 511) {}

    The package setup script has attempted to modify files on your system
    that are not within the EasyInstall build area, and has been aborted.

    This package cannot be safely installed by EasyInstall, and may not
    support alternate installation locations even if you run its setup
    script by hand.  Please inform the package's author and the EasyInstall
    maintainers to find out if a fix or workaround is available.

    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.