I've installed Canopy and completed the environment setup. Unfortunately, nothing I input into the code editor gets printed onto the Python interpreter pane (e.g. I input print "hello world" and hit enter but nothing happens. Also, the Run > Run File command is grayed out. My directory is set at "Keep directory synced to Editor".
What's gone wrong?
I met the same problem. I solved the problem by creating an account, requesting an academic license (as a student) and logging in on the welcome screen with my account. I am not sure whether the second step (requesting a license) is necessary but you can try. See the pic below. Run and Debugging buttons are active after signing in.
I had the same problem. I.e., I could not run any code or see anything in the Python Pane. Try restarting the kernel. That worked for me.
Run -> Restart kernel...
or Ctrl + .
Related
I just pressed that triangle to run the code. I want that button to work because I want to use the debug mode from that button. When I click it, it tries to run three times and it somehow got into anaconda. I checked Python default interpreter path in preferences>settings and it is set to C:\Users\ucanc\AppData\Local\Programs\Python\Python39\python.exe, not the anaconda one. I am pretty new to this and I do not know what is going on.
edit: It seems like it is running as WSL termial that is why it has name#LAPTOP-xxxx:/mnt/c/ in the front.
Im really quite new to coding and brand new to Python so apologies if this is a dumb question.
I'm writing basic scripts in VS Code and when I run them the result in the terminal is just..... ugly. Instead of just printing the result of my code, it prints details about my version of Windows, a little copyright notice, the full file path to my code... then eventually gets round to executing my actual code.
Is there any way for me to configure the terminal so that it just shows my code and not all the other bits? I've already seem about an extension called Code Runner, but this prints to the "Output" tab and doesn't allow any user input
If you are using PowerShell, you can add "args": ["-NoLogo"], like this to Hides the copyright banner at startup :
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell",
"path": ["C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"],
"args": ["-NoLogo"],
}
},
And you also can change the value of console in the launch.json file. But internalConsole does not accept the user input. And externalTerminal will prompt a cmd window out of the VSCode.
Maybe you can try Jupyter code cells:
https://code.visualstudio.com/docs/python/jupyter-support-py
Try jupyter on visual studio code interface
https://code.visualstudio.com/docs/datascience/jupyter-notebooks
You have to follow these steps:
install python extension for vs code.
python extension
2.After installing reopen vs code and you will see a play button at right-top corner.
play button
3.Click that button and run your code!
go to settings
search for terminal
find Code-runner : Run in Terminal and turn that off.
I tried to run a python program in VS Code. But my program didn't run. The terminal opened and a weird arrow was there in the terminal. This is the screenshot of that.
This is the weird arrow and the program is not running. Any ideas why this is happening and how to fix it?
Thanks in advance.
Firstly, the arrows are included in the default python IDE means that VScode ran the command to execute your code. Give your pc a restart. Now, let us check if python is working or not or VS code is having some trouble. Type the following command in cmd to execute the code-
python "$PATH"
Rember to replace $PATH to the path of the file i.e where your file is stored. For eg. I've my python files stored in D drive in a python folder, so I'll use-
python "D:\Python\Hello.py"
If this works, python is working fine and if not, try reinstalling python and check the box which says Add python to Path or Environment variables. Then open VS code try to run the program again. But click the button only once and be patient because clicking it multiple times causes execute the same command again and cause a problem. It's my personal experience. Wait 5 minutes. Not works. Don't worry, there's a problem with the run extension you are using. I'll recommend the Code runner by Jun han. I personally use it. Type this in the extension search box-
formulahendry.code-runner
Install it and then try again.
Kill the terminal, and retry. If not work, restart the VSCode.
Installed PyCharm on the new windows10.
If i create a new project everything works ok - all buttons on the places.
But if i run ANY .py file associated with pycharm i see just the code and no Run or configure buttons. There is also no indexing\something bar at the bottom. I've waited for couple hours and nothing changed.
The same thing on new linux.
What am i doing wrong?
(i also can't rightclick the file cuz 'nothing here' appears)
as you can see - no buttons..?
SOLVED.
solution
1. Uninstall PyCharm 20.x.x
2. Install PyCharm 19.x.x
Seems you started PyCharm in the light edit mode (see https://blog.jetbrains.com/idea/2020/04/lightedit-mode/), try to run PyCharm first and then create project on top of your directory or just open this directory.
Pycharm associated all .py to edit, you will open the source code.
To run, try "right click" and search for "RUN" or click "CTRL+SHIFT+F10"
Here is a link to the jetbrain tutorial on how to open/hide a navigation bar.
Use the navigation bar
This is because when you install Pycharm and start with new scratch file, Pycharm doesn't know which file you want to run so you can see Run. To Run your script Right-Click in the space and then click on Run. After this you will get a Run button in the top-right of the corner.
Hope it helps!
Currently I am doing some debugging on a script but when I run it the second time I get a false outcome. Now I want to restart the IPython console everytime when I run my script e.i. I want to include it in my script and do it automatically. I already tried to clear and restart my console but that doesn’t work. Has somebody an idea how I can solve this problem?
Thank you for your help!
Do you want to clear out all variables from previous run when you re-run the script? If yes, you can change the preference settings in Spyder.
Go to Tools > Preferences > Run > Check the box that says "Clear all variables before execution."