running vpython in a virtual environment - virtualenv

I am running python 3.9.9 in vs code and Windows 10. When I run vpython in a standard(global) program my browser opens and the picture appears. When I run vpython in a virtual environment the browser opens but there is no picture, just a white screen and I do not get error messages.
Sample code:
from vpython import *
myBox = box(length=2,width=1,height=2, color=color.red)
while True:
pass

You should first try restarting your computer, the same thing happened to me before, if that still doesn't work, maybe try reinstalling Visual Studio Code or VPython

Related

Running many files in Visual studio code

How can I get made code files running at the same time in VS code app?
When I run say my_pomodoro_app.py which comes with a Tkinter window, I am unable to run any other code file unless I close my pomodoro app. This does not happen in Pycharm.
Is that how VS code works? Or I have to do some settings to enable running mmany programs?
I search on the internet but coudn't get the solution

VSCode hangs when trying to run a Jupyter notebook?

I am trying to run a Jupyter notebook in VSCode. I have successfully run notebooks in the past, but something has happened to make VSCode "hang" when I try running. When I hit run, the terminal shows the file location and the location of python.exe as expected (shown in the first image, with some personal information redacted), but nothing ever happens. The code never completes and the cells never output. I get a small "pending" icon of a clock and an arrow (shown in the second image) to tell me a cell is running, but even the most basic "Hello, world" never completes or gives an error. I have no trouble running regular python files, and if I export an ipynb to py I can run it, but I cannot run the ipynb itself. Trying to restart the Jupyter kernel also seems to hang, never completing and never crashing or erroring. The only clue I really have is that when I hit F5 to run, there's no python version showing in the bottom left corner, the way there is when I run py files (third image is while trying to run ipynb and fourth image is while successfully running py).
I have tried uninstalling and reinstalling the Jupyter extension from VSCode and restarting VSCode between every step. I have tried swapping between python.exe and conda.exe in the terminal settings python.condapath. I have checked that the windows terminal is cmd. I've tried creating new notebooks in VSCode that only have print("Hello, world"). I have tried the command "Select interpreter to start Jupyter server" and selected the correct version of Python, but nothing has changed any time I've tried to run.
I am using Anaconda version 4.10.3, VSCode 1.61.2, IPython version 7.9.0, and Jupyter notebook version 6.4.3.

How can I get VSCODE Pico-go and CircuitPython extension commands to work

I have installed pico-go extension in VSCode. When I do any View>Command Palette>Pico-Go > Help > Show Pico Pin Map... I always get Command 'Pico-Go > Help > Show Pico Pin Map' resulted in an error (command 'picogo.extra.pins' not found).
I get a similar error for any pico-go command. I have installed different versions of the Pico-go code, did restart after each and the problem is exhibited in all the versions I have tested. Pico-go states that it is dependent on Python 3 and Python3.9.1 that is installed and running in VSCode.
I have the same problem using CircuitPython commands on both systems. The Dependencies list includes Python and Juypter which are both installed.
I have a second system that has pico-go installed and it works properly. I do not know how to isolate what is wrong in the first system.
Even if I get this problem solved the getting started code
from machine import Pin
import time
pin = Pin(25, Pin.out)
while True:
pin.toggle()
time.sleep_ms(1000)
fails with
File "e:\code.py", line 1, in <module>
from machine import Pin
ModuleNotFoundError: No module named 'machine'
Make sure you click the RUN that's at the bottom of the screen (in the window border) and not the tempting one at the top. The one at the top will run your Python code on your computer, which doesn't know what the Machine any other Pico-specific library is. The one at the bottom sends the code to the Pico and runs it there - you can confirm because "Pico Console" will be listed and not "Python".

Unable to install VisualStudio Code in Windows 10

I have a Windows 10 with the latest patches and downloaded the VisualStudio Code setup from the official page but when I double click the .exe nothing happens, it does open a dialog and no error is displayed, just nothing happens, I tried running it as admin, restarting the machine multiple times, always the same result.
It just happens with this specific .exe, I tried with several other installations and it works fine.
Is there a way to see what could be blocking the installation?
Use Chocolatey to install visual studio code if you can't install it by clicking the exe file. See the folowing link:
chocolatey.org/packages/vscode

Visual Studio Code can't run in Ubuntu 18.04

I have been using VSCode for a while and never had any big problem with it. Today I tried to start my VSCode from left taskbar on my Ubuntu 18.04 and it not showing up. Also, I tried to run in terminal as 'code .' again nothing.
VSCode version is latest 1.23.1 I tried few time today with install/remove and nothing. Somehow I am thinking maybe it something with permissions but not sure.
When click on task bar icon its shows like loading on top taskbar in ubuntu 18.04 for a few seconds and stops.
Also when tried to run in terminal as:
$ code . --verbose
[15027:0603/191139.702752:ERROR:browser_main_loop.cc(279)] Gtk: Locale not supported by C library.
Using the fallback 'C' locale.
[15027:0603/191139.809312:ERROR:browser_main_loop.cc(279)] Gtk: GModule (/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-ibus.so) initialization check failed: GLib version too old (micro mismatch)
[15027:0603/191139.809326:ERROR:browser_main_loop.cc(279)] Gtk: Loading IM context type 'ibus' failed
pcilib: Cannot open /sys/bus/pci/devices/0000:07:00.0/resource: No such file or directory
just getting an error, but not sure is this error connected with problem I did some investigation and Gtk is already installed and works well on my OS.
Fixed it with "delete the /home/user/.config/Code folder"
https://github.com/Microsoft/vscode/issues/55774#issuecomment-412774473