Python Development PyDev

Has anyone used Python Development? I’m having trouble setting it up, it says I need java 8. Would java 11 work, and how do I set up Java in VS Code?

1 Like

Yes. From PyDev’s blog:

The requisites are having java 8 (or higher) installed on the system (if it doesn’t find it automatically the java home location may need to be specified in the settings – http://www.pydev.org/vscode/ has more details) and Python 2.6 or newer .

  1. If it’s about installing PyDev and integrating it with VS Code, you need to install Java on your system which is independent of VS Code. Install it from the the official page of Java. If you’re on a Linux-based distribution, instead of the proprietary Java you may want to install the open-source openjdk-11-jre from your package manager.

  2. After installing, you need to install PyDev’s extension on VS Code to complete the integration. You may also need to configure some PATH settings, refer to PyDev’s VS Code manual.

1 Like

Ok, I installed Java. I have I think version 8, I know I have version 11. can I integrate version 11?

1 Like

You can. My post above has all the necessary links to configure the extension afterwards.

1 Like

OK, I see, I’m not sure how to enter the path in VS Code, I’m not seeing it on this page

1 Like

so where is the path, I don’t see path anywhere under settings for Java

1 Like

You only need to manually define the PATH variables if PyDev extension fails to do so by itself. You define them inside VS Code settings.json. See details: Visual Studio Code User and Workspace Settings.

1 Like

I have this file messed up, if this is sorted, then I can show the error messages.

1 Like

Not sure why you put what seems like the Java path on PYTHONPATH. From the PyDev’s manual:

python.pydev.pythonPath:
A list of folders that should be added to the PYTHONPATH and should be considered source folders (i.e.: folders with the sources meant to be edited by the user).
If not specified, the folders which are in the PYTHONPATH and are available below a workspace in vscode will be considered as source folders (and if there’s no match, each workspace folder in vscode will be considered a source folder).

You need to put your Python interpreter executable path in that field. If you’re inside a virtual environment, which you should use, type in the virtual environment Python path. Or just for testing purpose you can put the system Python path, this should be /usr/bin/python3 on Ubuntu.

1 Like

I changed the executable path to the one you showed, and it still shows the same error. I wonder if I’m making a more basic error like a syntax mistake in my array. A missing or extra comma, or something along those lines.

1 Like

What’s the full error message? Provide screenshots if need be.

1 Like

Screenshot from 2021-02-05 18-07-08|690x388

This says it’s missing a colon, but there is a colon, that is red.

1 Like

Go to Problems panel at the bottom, it should show you all the lines with syntax errors, fix all of them one by one. It is likely some missing closing symbols. If you’re still not sure, can you paste the code here? I’m guessing the trailing t at the end is just another silly mistake.

1 Like

I’m not comfortable with JavaScript, and I’m affraid that I’m making it worse.

1 Like

Ah I notice the syntax issues. Here’s the fixed JSON:

}    
    "terminal.integrated.commandsToSkipShell": [
        "language.julia.interrupt",
    ],
    "julia.enableTelemetry": true,
    "julia.executablePath": "<path>",
    "crystal-lang.mainFile": "<path>",
    "python.pydev.pythonPath": "<path>",

}

Replace the <path> with yours as before. Notice the changes I made, here’s a JSON fundamentals guide which should explain what were your mistakes.

1 Like

I think that fixed julia, and PyDev shows up as an option, but a PyDev dockument does not have highlights, and when I try to open output, I get this error:

Command 'PyDev: Open output' resulted in an error (command 'pydev.open.output' not found)

In the JSON

{
	"resource": "/home/brett/.config/Code/User/settings.json",
	"owner": "_generated_diagnostic_collection_name_#1",
	"severity": 8,
	"message": "Expected a JSON object, array or literal.",
	"source": "jsonc",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 2
}

is what I get when I copy the error. The first squiggly bracket has a red squiggly underline,and it says:

Expected a JSON object, array, or literal

If this is strictly related to PyDev, I cannot help you with this. You may get better answer by asking here as referred by the PyDev’s author. Include all the details that you showed me.

VS Code has rich Python support through its own set of extensions, PyDev seems not to rely on those what I gathered from its manual. If someone else here knows more about this, feel free to add anything.

OK, I’m not finding much on Stach Overflow, and I’m not able to post (I’ve seemed to ask badly written question, which I should improve, but anyways), so I’m not sure where to go, I also have the Processing extension, and Processing is what I use for .pyde

I found a mistake in your correction, (top curly bracket was backwards), so the JSON works, but it’s saying I need to have Java set up. I’ve never used Java before, and don’t know how to do that.