Questions tagged [pythoninterpreter]

The PythonInterpreter class is a standard wrapper for a Jython interpreter for embedding in a Java application.

The PythonInterpreter class is a standard wrapper for a Jython interpreter for embedding in a Java application. Javadoc can be found [here].(http://www.jython.org/javadoc/org/python/util/PythonInterpreter.html)

127 questions
1
vote
2 answers

Import numpy in vsCode could not be resolved

I am currently working in VSCode and attempting to import various libraries into my file. I am currently using the interpreter image of interpreter. The remainder of my code is shown remainder of code. I do not understand why my numpy is unable to…
Elias Lind
  • 49
  • 1
  • 5
1
vote
1 answer

How to add Python Interpreter to PyCharm?

I followed a lot suggestions to add the interpreter to PyCharm, but they're simply not working. I want to figure out what the exact problem is here. First, it said no interpreter is found, so I tried using Python 3.10 in Anaconda. But it seems "pip…
1
vote
3 answers

How can I use a specific python interpreter to run my python file

I created a python file and used some packages. I installed packages on a virtual Environment. Now, when I try to run that file, it run on the default installed interpreter and I have to activate the virtual Environment every time I have to run that…
Ishant
  • 21
  • 2
1
vote
1 answer

File "__pyclasspath__/site.py", line 178 file=sys.stderr) SyntaxError: mismatched input '=' expecting RPAREN

I am trying to call python code from java file using Jython 2.7.2 with python files using version 3.9 but getting the error. Java code as below: PythonInterpreter interpreter = new PythonInterpreter(); …
1
vote
2 answers

Interpret python code within python program

Is there a library for interpreting python code within a python program? Sample usage might look like this.. code = """ def hello(): return 'hello' hello() """ output = Interpreter.run(code) print(output) which then outputs hello
Riven
  • 375
  • 2
  • 11
1
vote
1 answer

PyCharm not using correct Python version/interpreter

I am facing a strange issue in PyCharm. I have defined a virtual environment "(venv)" having Python3.8 as base as interpreter for project along with rest of packages required for the project. The same is selected in project run/debug configuration…
Abhinav
  • 1,882
  • 1
  • 18
  • 34
1
vote
1 answer

Installing gurobipy package in a custom virtual enviroment in Pycharm

First of all thanks in advance, and sorry if I made the question too long, I tried to be the clearest as possible. I am trying to install the gurobipy module in my enviroment on Pycharm. I have already installed gurobi on my computer (Version 9.0.2)…
OMaeloc
  • 31
  • 3
1
vote
1 answer

Jython: Can not import python function in Java

I am trying to develop a simple Java application and I want it to use some Python code using Jython. I am trying to run a python method from a file and getting this error: ImportError: cannot import name testFunction Just trying a simple example so…
1
vote
2 answers

Do executables like pip.exe require python to work?

I am relatively new to Python so please pardon my ignorance. I want to know answer to following questions How does pip know the location to install packages that it installs? After a built of trial and error I suspect that it maybe hardcoded at…
user83335
  • 31
  • 4
1
vote
2 answers

Python script correctly executes every statement, but also returns ModuleNotFoundError

I'm running my Python script in Terminal on MacOS. The script1.py source code: # A first Python script import sys # Load a library module print(sys.platform) print(2 ** 100) # Raise 2 to a power x =…
bhp
  • 101
  • 1
  • 7
1
vote
0 answers

Cannot select a python interpreter in VScode

I'm having some troubles trying to select a python interpreter in VScode. As you can see in this picture (VScode: select python interpreter), VScode asks me to select a python interpreter but when I click on it, it doesn't present me any options:…
1
vote
1 answer

from googleapiclient.discovery import build ModuleNotFoundError: No module named 'googleapiclient'

Visual Studio blows the below error: from googleapiclient.discovery import build ModuleNotFoundError: No module named 'googleapiclient' when I am running a script that reads google sheets using the: from googleapiclient.discovery import build…
greenszpila
  • 193
  • 1
  • 1
  • 14
1
vote
0 answers

ImportError: No module named while executing python code in Netbeans

I am trying to call python code in NetBeans and mentioned the right version of python and set the path too but still am getting ImportError: No module named pandas Already set path and environment variable. PythonInterpreter interpreter = new…
1
vote
0 answers

Using python interpreter using ssh connection on Slum cluster server using Pycharm

I want to use the ssh interpreter of pycharm IDE here is the problems that I have. I successfully connected to the cluster. I used SSHF and mount my files on the server to my local machine. Now after defining the project on pycharm and using the…
Ehsan
  • 286
  • 2
  • 4
  • 14
1
vote
2 answers

How does the Python's stack work when dealing with tuples/lists?

I saw in Python documentation that the BUILD_TUPLE instruction "Creates a tuple consuming count items from the stack, and pushes the resulting tuple onto the stack." It really pushes the tuple itself? What if the tuple contains a large number of…
1 2
3
8 9