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
Related
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
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).
I am programming in Python 3 and I recently found Atom editor. It looks amazing and has a great functionality. I want to ask, if there is a package or any way of having an interactive python shell in the Atom editor. And no, I am not looking for simple script executing package such as the script package or the Hydrogen package.
I need this:
(shell.jpg)
Thanks.
Been a while since I used Atom. There is a package (probably several) you can install that gives you a built in bash/cmd shell, simply execute "python" from that and you'll get an interactive python shell.
There is an Repl package that brings up a separate python shell console. I find it very useful and you can open the console for python2 or python 3.
I'm highly confused about this. Python3 is installed per default on the MacBook.
which python3 will output /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
Great, so that's my SDK to put into IntelliJ IDEA, one should think.
I have the Python plugin for IDEA. However, I can't run Python files. So I try to change the configuration and set it to the above PATH for the Python interpreter.
However, still nothing. Trying to run the Python file inside IDEA will prompt a new configuration?
I can run the script just file doing python3 script.py in the terminal? I know the path for the Python3 library, yet, IDEA doesn't recognise it at all and doesn't save the configuration.
What am I doing wrong in this process? This should be fairly easy to set up but turns out it isn't :)
I even tried to create a Python 3.6.2 virtual environment with the IDEA internal tool - same thing? It doesn't allow me to run the Python3 script from inside IDEA.
Should I use python from usr/bin/python? If I cd there, I can see Python3. But inside IDEA, i only have access to Python2..
After installing Python 3.8.1 via pyenv which I now recommend over using Homebrew (see https://github.com/pyenv/pyenv), I did the following to add this version to IntelliJ IDEA.
Close all open projects. This will display the Welcome to IntelliJ IDEA window listing recent projects along the left.
Click on Configure -> Structure for New Projects
Click on SDKs under Platform Settings along the left
Click on the + sign above the SDK list and select Python SDK
From the Add Python Interpreter window, select System Interpreter
Click on the ... button to the right of the Interpreter drop down and browse to $HOME/.pyenv/versions/3.8.1/bin/python. Replace 3.8.1 with the desired Python version if you want to configure another version.
Updated for IntelliJ IDEA 2019.3.3
Try this in menu of IDEA: File -> Settings -> Project: Name of project -> Project Interpreter and from above in the window you can choice interpreter version or virtualenv.
Assume you imported a package, say unittest2
if you were using Windows IDLE, if you press:
unittest2.
a small help window will pop up and show the list of functions you can use, similarly how can I get this small pop up on linux ?
Am accessing a linux box from putty
If you want to use IDE, then Pycharm should be what you are looking for . Please refer to download and install it.
If you are using Vim editor, then python-mode plugin will do all this jobs for you. Please see this picture:
.
Here is a few of many editors you might use in the Linux:
For python IDE:
PyCharm: https://www.jetbrains.com/pycharm/help/auto-completing-code.html
For generic editors:
vi/vim: http://vim.wikia.com/wiki/Any_word_completion
emacs: http://emacswiki.org/emacs/AutoComplete
BTW, if in the Python interpreter:
http://conjurecode.com/enable-auto-complete-in-python-interpreter/