![]() ![]() ![]() used tools like Git and Visual Studio to define projects and keep the source code up. Activate the environment(Ctrl+Shift+`), by the command 'pip3 -version' to check which pip3 you are using, then install the package you want to import. To install pipenv, just use Homebrew on Mac: brew install pipenv. But in VSCode you haven't chosen this environment.Ĭhoose an environment or create a virtual environment(recommend). This is the default python interpreter because of the system environment variables settings. 1 When I try to run some python code on Visual Studio Code terminal gives me the error: Running python -u '.project path. I have the following code which I am running from within Visual Studio Code using Right click > Run Python File in Terminal import threading def worker(tid): '''This is what the thread act. But you haven't chosen this environment in your VSCode.īy command "pip3 -version" to check which pip you are using.īy command "python3" -> "import sys sys.executable" to check which python you are using.īy command "python3" -> "import sys sys.path" to check which 'site-package' the interpreter searching for.įrom your description, you are using the pip which under '/usr/local', install the packages under '/usr/local/lib/python3.7/site-packages', using python interpreter of '/usr/local/bin/python3'. This means you had installed the package 'pandas' and it worked. When I run a simple Python program like the following, VS Code uses Python 2.7 as installed on my Mac. You said you had created a python file to run pandas and it worked. Im running VS Code 1.33.1 on macOS Sierra (10.12.6). It just because you had chosen the wrong python environment in VSCode. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |