Is it possible to write command line in Spyder Ipyhton console? - python

I use Anaconda installed Spyder on Windows. I need to write a command-line for a package to work.
Could I write command-line code on Ipyhton Console of Spyder? Is it possible and how? If not where should I write command-line inside Spyder? Do I have to download a package? I am a beginner at computer science. Thanks for your help
Note: I have made an internet research, the most related article is below but it didn't work for Spyder Ipython console.
https://jakevdp.github.io/PythonDataScienceHandbook/01.05-ipython-and-shell-commands.html

Related

Cannot use python in VSCode

I simply want be able to execute python commands in VSCode.
I have already installed it by the marketplace and the main software on my computer.
Once I would have finished the python problem I am looking to install brownie, but I first need the ability to execute python commands in the VSCode terminal "pip install...".
Can you help me out?

Arrow up / previous command in VSCode Python Interactive not working

I'm working with VSCode on an Ubuntu 18.04 machine. Everything is fine except that I can't get back to the previous command in Python Interactive Window via Arrow Up. It works in the integrated terminal though, integrated shell is /bin/bash.
I have no idea where this is coming from. I changed "keyboard.dispatch" to "keyCode", but that's not the problem. I also tried different versions of the python-extension.
Do you have any idea?
Thanks!
Not sure if this is helpful for you as an Ubuntu user, but I came across the same problem in Windows this week. In my case, the issue cropped up after I installed the Python extension in VS Code (or at least I didn't notice the issue before this). The combination of using the Python extension, Git Bash for terminal, and python virtual environment killed the up arrow feature for me. Using python outside a virtual environment works fine. My solution was to use Command Prompt as the terminal when I wanted to use a virtual environment interactively.
In my situation, although I delete all the shortcuts of UpArrow, I still can get the previous command through UpArrow in Python interactive. This means there's no way to configure this shortcut, it was built in the plugin which built in Python extension.
So it's some problem with your Python extension, but you said you have tried to install a different version of Python extension but still not work. Make sure you have deleted it completely -> delete the extension folder manually(it's under C:\Users[UserName].vscode\extensions\ms-python.python-xxx).

Python Running .py File with my Python Anaconda Version

I think I am close to solving my issues but need a little help.
Computer: Mac
My situation: wrote a script in Jupyter Notebooks (.ipynb) and I wanted to run it from IDLE. So I downloaded the .ipynb as a .py file. When I open up the file it opens in Idle and when I go to run the file it says I do not have the module/packages installed.
At the top of the .py file it put #!/usr/bin/env python
When I run which python in my terminal I get /opt/anaconda3/bin/python.
So I am thinking IDLE is running the script through a different environment of python. How do I change it so IDLE will run the script through the python Anaconda also uses?
Thank you!
It is possible that you have more than one python in your OS. Just check the versions in prompt with --version. If you get different python version you need to delete one that you dont use. It is generally the other than anaconda one.

Is it possible to get code editors in virtualenv?

I recently downloaded virtualenv on my MacOSX Sierra (10.12.2). I'm not very experienced with virtualenv and I've been coding using the interactive interpreter in terminal and I was wondering if there was an alternate way that I could use an editor(IDLE, Sublime, etc.) and still use it in virtualenv. Would I just install an editor into virtualenv or am I limited to only the interactive shell?
You are not limited to only interactive shell. For your coding part you can download and install sublime text and open your project (any project irrespective of the language you use) and get started. Here is a quick guide for getting started in sublime text : sublime text getting started
You might also want to take a look at this post: SublimeREPL plugin
You can use atom editor, inside that you can use virtualenv plugin

How can I run a python program in Komodo IDE like in IDLE(Python GUI) using Run Module feature?

Sorry I am a Python beginner and after several months with Python(GUI) I now want to move to Komodo IDE 8.5 (Suggested by posts on this forum), but I had trouble on configuring it to proper use. The main issue is how I can run a Python program in Komodo like in IDLE(Python GUI) using Run Module (pressing F5) feature?
When I pressed F5 in Komodo IDE 8.5, I got message "No Python interpreter is available".
I am using Python 3.30. Python.exe is in this path "D:\1_tools\python". Komodo.exe is in this path "D:\1_tools\komodo_IDE"
Thanks for any kind helpers. I have searched the forum but did not get any helpful info. Thanks again.
There is a thread on the Komodo Community Site that discusses this exact situation. (http://community.activestate.com/node/10113)
Sumarizing:
It seems that Komodo IDE defaults to using Python2 and since it can't find a Python2 interpreter, it complains.
Solution:
For existing files, the suggested solution is to tell Komodo IDE (via "Properties and Settings" on the Editor Tab) that the file uses the Python 3 interpreter.
If you create all new python source files using the Python3 template, the IDE will be able to run them. Beware: The first time you want to use the Python3 template you will have to create the new file using the menu: "File" -> "New" -> "File from Template", then select the Python 3 template.
Is Python on your PATH? That is, if you open a command prompt and type python by itself, does it run? In Komodo, look under Edit/Preferences/Languages/Python3 and check the configuration. If python.exe is not on your PATH you can provide the full path to it there

Categories

Resources