Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandas ExcelWriter Generates 'Cannot Instantiate Abstract Class' Error Incorrectly #386

Closed
iUnknwn opened this issue Sep 17, 2020 · 2 comments
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs

Comments

@iUnknwn
Copy link

iUnknwn commented Sep 17, 2020

Environment data

  • Language Server version: 2020.8.2
  • OS and version: Win10 x64, build 1909
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.3, Miniconda 4.8.2.

Expected behaviour

Pyright does not show an error on the line pd.ExcelWriter('pandas_simple.xlsx', engine='xlsxwriter')

Actual behaviour

Pyright flags the line with this error:

Cannot instantiate abstract class "ExcelWriter"
  "ExcelWriter.supported_extensions" is abstract
  "ExcelWriter.engine" is abstract
  and 2 more...Pylance (reportGeneralTypeIssues)

Logs

User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - enabled'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'LocalZMQKernel - experiment'
User belongs to experiment group 'CollectLSRequestTiming - experiment'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - control'
User belongs to experiment group 'CustomEditorSupport - control'
User belongs to experiment group 'pythonaa'
User belongs to experiment group 'pythonTipPromptWording'
> conda --version
> pyenv root
> python3.7 c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.7 c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.6 c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3 c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -2 c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Error 2020-09-17 15:22:48: Detection of Python Interpreter for Command py and args -2 failed as file  does not exist
Error 2020-09-17 15:22:49: Detection of Python Interpreter for Command python3 and args  failed as file  does not exist
Error 2020-09-17 15:22:49: Failed to check if file needs to be fixed [EntryNotFound (FileSystemError): Unable to read file 'c:\GitProjects\ExcelWriter\.vscode\settings.json' (EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open 'c:\GitProjects\ExcelWriter\.vscode\settings.json')
	at _handleError (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:657:25)
	at processTicksAndRejections (internal/process/task_queues.js:85:5)
	at async v.readText (c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\out\client\extension.js:1:495817)
	at async p.doesFileNeedToBeFixed (c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\out\client\extension.js:56:953520)
	at async c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\out\client\extension.js:56:952647
	at async Promise.all (index 1)
	at async p.getFilesToBeFixed (c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\out\client\extension.js:56:952593)
	at async p.updateTestSettings (c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\out\client\extension.js:56:952220)] {
  code: 'FileNotFound',
  name: 'EntryNotFound (FileSystemError)'
}
Starting Pylance language server.
Python interpreter path: .\venv\Scripts\python.exe
Error 2020-09-17 15:22:49: Failed to get interpreter information for 'C:\Users\USERNAME_HERE\AppData\Local\Microsoft\WindowsApps\python3.exe' [Error: Command failed: "C:\\Users\USERNAME_HERE\AppData\Local\Microsoft\WindowsApps\python3.exe" "c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py" "c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\interpreterInfo.py"
Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640
	at ChildProcess.exithandler (child_process.js:308:12)
	at ChildProcess.emit (events.js:203:13)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)] {
  killed: false,
  code: 9009,
  signal: null,
  cmd: '"C:\\\\Users\\USERNAME_HERE\\AppData\\Local\\Microsoft\\WindowsApps\\python3.exe" "c:\\Users\\USERNAME_HERE\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles\\pyvsc-run-isolated.py" "c:\\Users\\USERNAME_HERE\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles\\interpreterInfo.py"'
}
Error 2020-09-17 15:22:49: Failed to get interpreter information for 'C:\Users\USERNAME_HERE\AppData\Local\Microsoft\WindowsApps\python.exe' [Error: Command failed: "C:\\Users\USERNAME_HERE\AppData\Local\Microsoft\WindowsApps\python.exe" "c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py" "c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\interpreterInfo.py"
Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640
	at ChildProcess.exithandler (child_process.js:308:12)
	at ChildProcess.emit (events.js:203:13)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)] {
  killed: false,
  code: 9009,
  signal: null,
  cmd: '"C:\\\\Users\\USERNAME_HERE\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe" "c:\\Users\\USERNAME_HERE\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles\\pyvsc-run-isolated.py" "c:\\Users\\USERNAME_HERE\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles\\interpreterInfo.py"'
}
Error 2020-09-17 15:22:49: Failed to get interpreter information for 'C:\Users\USERNAME_HERE\AppData\Local\Microsoft\WindowsApps\python.exe' [Error: Command failed: "C:\\Users\USERNAME_HERE\AppData\Local\Microsoft\WindowsApps\python.exe" "c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py" "c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\interpreterInfo.py"
Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640
	at ChildProcess.exithandler (child_process.js:308:12)
	at ChildProcess.emit (events.js:203:13)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)] {
  killed: false,
  code: 9009,
  signal: null,
  cmd: '"C:\\\\Users\\USERNAME_HERE\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe" "c:\\Users\\USERNAME_HERE\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles\\pyvsc-run-isolated.py" "c:\\Users\\USERNAME_HERE\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles\\interpreterInfo.py"'
}
Error 2020-09-17 15:22:49: Failed to get interpreter information for 'C:\Users\USERNAME_HERE\AppData\Local\Microsoft\WindowsApps\python3.exe' [Error: Command failed: "C:\\Users\USERNAME_HERE\AppData\Local\Microsoft\WindowsApps\python3.exe" "c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py" "c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\interpreterInfo.py"
Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640
	at ChildProcess.exithandler (child_process.js:308:12)
	at ChildProcess.emit (events.js:203:13)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)] {
  killed: false,
  code: 9009,
  signal: null,
  cmd: '"C:\\\\Users\\USERNAME_HERE\\AppData\\Local\\Microsoft\\WindowsApps\\python3.exe" "c:\\Users\\USERNAME_HERE\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles\\pyvsc-run-isolated.py" "c:\\Users\\USERNAME_HERE\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles\\interpreterInfo.py"'
}
> conda info --json
> conda env list
> conda info --json
> conda info --json
> conda info --json
> conda env list
> ~\AppData\Local\Continuum\miniconda3\python.exe c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import jupyter"
> ~\AppData\Local\Continuum\miniconda3\python.exe c:\Users\USERNAME_HERE\.vscode\extensions\ms-python.python-2020.8.109390\pythonFiles\pyvsc-run-isolated.py -c "import notebook"

Code Snippet / Additional information

As far as I can tell, the code works as expected - I'm able to call pandas.ExcelWriter and generate an object. This is also consistent with the xlsxwriter docs

@jakebailey jakebailey added the bug Something isn't working label Sep 18, 2020
@github-actions github-actions bot removed the triage label Sep 18, 2020
@judej judej added typestub Issue relating to our bundled type stubs and removed bug Something isn't working labels Sep 21, 2020
@gramster
Copy link
Member

This is because pandas decorates some of the methods in this class with @abc.abstractmethod. I'll remove that decoration from the stubs.

@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Sep 25, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.9.7, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202097-30-september-2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs
Projects
None yet
Development

No branches or pull requests

4 participants