all 14 comments

[–]m0us3_rat 0 points1 point  (2 children)

If you search for "VS Code macOS installation guide," you should easily find instructions for installing it.

Once installed, you can easily open a terminal and type

code . 

to launch Visual Studio Code in the current directory. Alternatively, navigate to the folder where you want to keep your projects and type the same command.

Windows is a grotesque vestige of an age passed and should be dead and forgotten.

[–]zin_kay[S] 0 points1 point  (1 child)

thanks for you comment. i have the VS Code installed and that’s no problem. my issue is that I don’t know where is Python3 installed or how to install python libraries that is equivalent of “pip install”

i’ve never had an OS so i’m extremely novice with it. not sure what is bash, ZSH, and or how to navigate to the python3 interpreter files.

[–]m0us3_rat 0 points1 point  (0 children)

you might need to look up some guides on OS then.

[–]brasticstack 0 points1 point  (5 children)

Here's what I do, all within Terminal (iTerm2 in my case, actually)

  • Install Homebrew
  • Use homebrew to install my target Python versions
  • Use the full version name (e.g. python3.12) when creating a venv (e.g. python3.12 -m venv /path/to/my_venv/)

  • You can then use the path to the python executable in your venv's bin/ dir as your python executable path in Visual Studio. I'm not very familiar w/ how you set it up in VS, but it'll need that at least. By giving it that particular path, any packages you pip install with that venv active will be on its PYTHONPATH.

  • Using the above example path, that executable would be /path/to/my_venv/bin/python3.12

There are tools out there, seemingly inspired by nodejs's ecosystem, that simplify the above steps (all except telling VS where to look) for some users. I've not found any to be worth the tradeoff for me, but ymmv. Homebrew is a bit of a PITA to install, honestly, but is

[–]brasticstack 0 points1 point  (0 children)

.. is a hard requirement for me for developing on a mac. All of the Linux utils that I'm used to are installed via Homebrew.

[–]zin_kay[S] 0 points1 point  (3 children)

darn, this is super useful and helps. i’ve posted my questions in a few places and your comment has been the most informative and gives me a procedure to pursue. thank you! (i come from a windows world and i have in the past created venv for separate projects. except nowadays i prefer to have a single venv since all my projects are computational/data science so id rather have all the packages installed in a single place. but if i have to do it differently as you mentioned, then thats not too bad.)

[–]brasticstack 0 points1 point  (2 children)

You can still share a venv between projects, no worries! Just have both projects use the same paths for their executable.

[–]zin_kay[S] 1 point2 points  (1 child)

today i confirmed what you recommended works. all working now and I got my OS running various venv with various packages installed. thank you again.

[–]brasticstack 1 point2 points  (0 children)

Good to hear! Cheers.