question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"sort: unrecognized option '--host'" error when debugging any file.

See original GitHub issue

I’m not sure what the source of this problem is. Ptvsd seems to have inserted itself into every debug command, even after I removed the ‘attach’ option from launch.json. It makes it impossible to debug any Python file.

Environment data

  • VS Code version: 1.27.1
  • Extension version (available under the Extensions sidebar): 2018.8.0
  • OS and version: CentOS 7
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 5.2 Python 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): unknown
  • Relevant/affected Python packages and their versions: NA

Actual behavior

Here is the terminal output when I hit the debug button:

$ cd /home/mgroeneveld/ml-climatology-explorer ; env "PYTHONIOENCODING=UTF-8" "PYTHONUNBUFFERED=1" "PYTHONPATH=/home/mgroeneveld/.vscode/extensions/ms-python.python-2018.8.0/pythonFiles/experimental/ptvsd" /home/mgroeneveld/anaconda3/bin/python -m ptvsd --host localhost --port 42912 /home/mgroeneveld/ml-climatology-explorer/main.py
sort: unrecognized option '--host'

Expected behavior

I expect VS Code to enter debugging mode.

Steps to reproduce:

  1. Click debug button (integrated terminal mode) with at least 1 breakpoint in any trivial python file.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

None

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

None

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
groeneveldcommented, Sep 26, 2018

It turned out to be a problem with the default .bashrc provided on my computer.

0reactions
groeneveldcommented, Sep 18, 2018

@d3r3kk

$ /home/mgroeneveld/anaconda3/bin/python -c 'import sys; print([sys.executable, sys.version])'
['/home/mgroeneveld/anaconda3/bin/python', '3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) \n[GCC 7.2.0]']
['/home/mgroeneveld/anaconda3/bin/python3', '3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) \n[GCC 7.2.0]']

@DonJayamanne Great question! I don’t and have no idea why it’s appearing in this context.

$ env "ABC=1234" date
sort: cannot read: ABC=1234: No such file or directory
$ date
Tue Sep 18 16:29:55 EDT 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

unrecognized option '--host'" error when debugging any file ...
I expect VS Code to enter debugging mode. Steps to reproduce: Click debug button (integrated terminal mode) with at least 1 breakpoint in...
Read more >
DotNetCore 1.1 application compilation error: CS2007 ...
I was converting this application from Rc1 to 1.1, made necessary changes to project files, packages restored without errors, but while ...
Read more >
"tar: unrecognized option --warning" during 'apt-get install'
I ask because I suspect that you might be upgrading a debian 5 (currently "oldstable") server using sources pointing at debian 6 (currently...
Read more >
LFTP - the manual page
Every operation in lftp is reliable, that is any non-fatal error is handled ... Options: -T truncate output file -o <file> redirect debug...
Read more >
CUDA Compiler Driver NVCC
It allows running the compiled and linked executable without having to explicitly set the library path to the CUDA dynamic libraries. Unless a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found